学习时长:3小时
代码行数:未统计
博客数量:1篇
今天完成计网实验三的部分,也是最后一次实验
S1>enable
S1#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#vlan 10
S1(config-vlan)#interface fastethernet 0/1
S1(config-if)#switchport access vlan 10
S1(config-if)#interface fastethernet 0/2
S1(config-if)#switchport access vlan 10
S1(config-if)#exit
S1(config)#vlan 20
S1(config-vlan)#interface fastethernet 0/4
S1(config-if)#switchport access vlan 20
S1(config-if)#interface fastethernet 0/5
S1(config-if)#switchport access vlan 20
S1(config-if)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#show vlan
Vlan划分情况:
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig1/1, Gig1/2
10 VLAN0010 active Fa0/1, Fa0/2
20 VLAN0020 active Fa0/4, Fa0/5
②配置二层交换机S2
S2>enable
S2#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S2(config)#vlan 10
S2(config-vlan)#interface fastethernet 0/1
S2(config-if)#switchport access vlan 10
S2(config-if)#interface fastethernet 0/2
S2(config-if)#switchport access vlan 10
S2(config-if)#interface fastethernet 0/3
S2(config-if)#switchport access vlan 10
S2(config-if)#end
S2#
%SYS-5-CONFIG_I: Configured from console by console
S2#show vlan
Vlan划分结果
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig1/1, Gig1/2
10 VLAN0010 active Fa0/1, Fa0/2, Fa0/3
20 VLAN0020 active Fa0/3
③配置二层交换机S3
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S3
S3(config)#vlan 20
S3(config-vlan)#exit
S3(config)#interface vlan 20
S3(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
S3(config-if)#interface fastethernet 0/1
S3(config-if)#switchport access vlan 20
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upS3(config-if)#
S3(config-if)#exit
S3(config)#interface fastethernet 0/2
S3(config-if)#switchport access vlan 20
S3(config-if)# interface fastethernet 0/3
S3(config-if)#switchport access vlan 20
S3(config-if)#end
S3#
%SYS-5-CONFIG_I: Configured from console by console
Vlan划分结果
S3#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig1/1, Gig1/2
10 VLAN0010 active
20 VLAN0020 active Fa0/1, Fa0/2,Fa0/3
④配置二层交换机S4
Switch>enable
Switch#config
Configuring fr,om terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S4
S4(config)#vlan 20
S4(config-vlan)#exit
S4(config)#interface vlan 20
S4(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
S4(config-if)#interface fastethernet 0/1
S4(config-if)#switchport access vlan 20
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upS4(config-if)#
S4(config-if)#exit
S4(config)#interface fastethernet 0/2
S4(config-if)#switchport access vlan 20
S4(config-if)# interface fastethernet 0/3
S4(config-if)#switchport access vlan 20
S4(config-if)#end
S4#
%SYS-5-CONFIG_I: Configured from console by console
Vlan划分结果
S4#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gig1/1, Gig1/2
20 VLAN0020 active Fa0/1, Fa0/2,F0/3
⑤配置二层交换机S5(将F1/1端口设置为trunk模式)
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#interface fastethernet 0/2
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface fastethernet 0/1
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Vlan划分结果
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa4/1, Fa5/1
10 VLAN0010 active Fa2/1
20 VLAN0020 active Fa0/1, Fa3/1
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
⑥配置二层交换机S6(将F1/1端口设置为trunk模式)
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#interface fastethernet 2/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#interface fastethernet 3/1
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#interface fastethernet 1/1
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#
Vlan划分结果
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa4/1, Fa5/1
10 VLAN0010 active Fa2/1
20 VLAN0020 active Fa3/1
1002 fddi-default act/unsup
1003 token-ring-default act/unsup
1004 fddinet-default act/unsup
1005 trnet-default act/unsup
第四步:配置三层交换机(划分vlan,配置rip协议)
①配置三层交换机S35601
左边三层交换机
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S35601
S35601(config)#vlan 10
S35601(config-vlan)#exit
S35601(config)#vlan 20
S35601(config-vlan)#exit
S35601(config)#vlan 30
S35601(config-vlan)#
S35601(config-vlan)#exit
S35601(config)#interface vlan 10
S35601(config-if)#ip address 192.168.1.1 255.255.255.0
S35601(config-if)#no shutdown
S35601(config-if)#exit
S35601(config)#interface vlan 20
S35601(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
S35601(config-if)#interface fastethernet 0/2
S35601(config-if)#switchport access vlan 20
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upS35601(config-if)#exit
S35601(config)#interface vlan 20
S35601(config-if)#ip address 192.168.10.1 255.255.255.0
S35601(config-if)#no shutdown
S35601(config-if)#end
S35601#
%SYS-5-CONFIG_I: Configured from console by console
S35601#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S35601(config)#interface vlan 30
S35601(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
S35601(config-if)#interface fastethernet 0/3
S35601(config-if)#switchport access vlan 30
S35601(config-if)#exit
S35601(config)#interface vlan 30
S35601(config-if)#ip address 192.168.3.1
% Incomplete command.
S35601(config-if)#ip address 192.168.3.1 255.255.255.0
S35601(config-if)#no shutdown
S35601(config-if)#end
S35601#
%SYS-5-CONFIG_I: Configured from console by console
S35601#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig0/1, Gig0/2
10 VLAN0010 active Fa0/1
20 VLAN0020 active Fa0/2
30 VLAN0030 active Fa0/3
②配置三层交换机S35602
Switch>enable
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#interface fastethernet 0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#vlan 20
Switch(config-vlan)#interface fastethernet 0/2
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#vlan 30
Switch(config-vlan)#interface fastethernet 0/3
Switch(config-if)#switchport access vlan 30
Switch(config-if)#exit
Switch(config)#interface vlan 10
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
Switch(config-if)#ip address 192.168.5.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#interface vlan 20
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
Switch(config-if)#ip address 192.168.6.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#exit
Switch(config)#interface vlan 30
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
Switch(config-if)#ip address 192.168.7.1 255.255.255.0
Switch(config-if)#no shutdown
Switch(config-if)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#
Switch#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig0/1, Gig0/2
10 VLAN0010 active Fa0/1
20 VLAN0020 active Fa0/2
30 VLAN0030 active Fa0/3
第五步:配置路由器
①配置路由器R0
Router>enable
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R0
R0(config)#interface fastethernet 0/0
R0(config-if)#ip address 192.168.3.2 255.255.255.0
R0(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R0(config-if)#exit
R0(config)#interface serial 2/0
R0(config-if)#ip address 192.168.4.1 255.255.255.0
R0(config-if)#clock rate 64000
R0(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
R0(config-if)#end
R0#
%SYS-5-CONFIG_I: Configured from console by console
R0#
②配置路由器R1
Router>enable
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 192.168.5.2 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#interface serial 2/0
Router(config-if)#ip address 192.168.6.1 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
Router(config-if)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#
③配置路由器R2
Router>enable
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 192.168.9.2 255.255.255.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#interface serial 2/0
Router(config-if)#ip address 192.168.4.2 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
Router(config-if)#interface serial 3/0
Router(config-if)#ip address 192.168.8.2 255.255.255.0
Router(config-if)#clock rate 64000
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
Router(config-if)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#