R1 F0/0 192.168.255.1/30
F0/1 192.168.255.5/30
R2 F0/0 192.168.255.2/30
F0/1 192.168.7.1/24
hexin F0/1 192.168.255.6/30
F0/2 192.168.255.9/30
F0/3 192.168.255.13/30
F0/4 192.168.0.2/30
jiaoxue F0/1 192.168.255.10/30
bangong F0/1 192.168.255.14/30
防火墙 F0/0 192.168.0.1/30
pc7 192.168.7.0/24
配置如下:
S1
Switch>en
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
S1#vlan data
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
S1(vlan)#vtp doma jiaoxue
Domain name already set to jiaoxue.
S1(vlan)#vtp pass jiaoxue
Setting device VLAN database password to jiaoxue
S1(vlan)#vtp client
Setting device to VTP CLIENT mode.
S1(vlan)#exit
APPLY completed.
Exiting....
S1#
S1#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#int f0/1
S1(config-if)#switch
S1(config-if)#switchport mode trun
S1(config-if)#switchport mode trunk
S1(config-if)#int f0/2
S1(config-if)#swit acc vlan 11
S1(config-if)#int f0/3
S1(config-if)#swit acc vlan 12
S1(config-if)#exit
S1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
S1#wr
Building configuration...
[OK]
S1#
S2
Switch>en
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#ex
%SYS-5-CONFIG_I: Configured from console by console
S2#vlan data
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
S2(vlan)#vtp doma
S2(vlan)#vtp domain jiaoxue
Domain name already set to jiaoxue.
S2(vlan)#vtp pass jiaoxue
Setting device VLAN database password to jiaoxue
S2(vlan)#vtp client
Setting device to VTP CLIENT mode.
S2(vlan)#ex
APPLY completed.
Exiting....
S2#
S2(config)#int f0/1
S2(config-if)#switch mode trun
S2(config-if)#int f0/2
S2(config-if)#switc access vlan 13
S2(config-if)#int f0/3
S2(config-if)#switc access vlan 14
S2(config-if)#int f0/4
S2(config-if)#switc access vlan 15
S2(config-if)#
S2(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
S2#wr
Building configuration...
[OK]
S2#
S3
Switch>en
Switch#config
Switch(config)#hostname S3
S3(config)#end
S3#vlan data
S3(vlan)#vtp domain jiaoxue
Domain name already set to jiaoxue.
S3(vlan)#vtp pass jiaoxue
Setting device VLAN database password to jiaoxue
S3(vlan)#vtp cli
S3(vlan)#vtp client
Setting device to VTP CLIENT mode.
S3(vlan)#
S3(vlan)#ex
APPLY completed.
Exiting....
S3#
S3#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S3(config)#int f0/1
S3(config-if)#switch mode tru
S3(config-if)#int f0/2
S3(config-if)#switch acc
S3(config-if)#switch access vlan 16
S3(config-if)#end
%SYS-5-CONFIG_I: Configured from console by console
S3#wr
Building configuration...
[OK]
S3#
未完接下篇
S4
Switch>en
Switch#config
Switch(config)#hostname S4
S4(config)#ex
S4#vlan da
S4(vlan)#vtp domain bangong
Domain name already set to bangong.
S4(vlan)#vtp password bangong
Setting device VLAN database password to bangong
S4(vlan)#vtp client
Setting device to VTP CLIENT mode.
S4(vlan)#ex
APPLY completed.
Exiting....
S4#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
S4(config)#int range f0/2 - 24
S4(config-if-range)#switc
S4(config-if-range)#switchport acc vlan 18
S4(config-if-range)#ex
S4(config)#int f 0/1
S4(config-if)#switch mode trun
S4(config-if)#ex
办公
Switch>en
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname bangong
bangong(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
bangong#vlan data
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.
bangong(vlan)#vtp doma bangong
Changing VTP domain name from NULL to bangong
bangong(vlan)#vtp pass bangong
Setting device VLAN database password to bangong
bangong(vlan)#vtp server
Device mode already VTP SERVER.
bangong(vlan)#vlan 18
VLAN 18 added:
Name: VLAN0018
bangong(vlan)#vlan 19
VLAN 19 added:
Name: VLAN0019
bangong(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
bangong(vlan)#exit
APPLY completed.
Exiting....
bangong#
bangong#config
jiaoxue(config-if)#int vlan 18
jiaoxue(config-if)#ip address 192.168.18.1 255.255.255.0
jiaoxue(config-if)#int vlan 19
jiaoxue(config-if)#ip address 192.168.19.1 255.255.255.0
jiaoxue(config-if)#int vlan 20
jiaoxue(config-if)#ip address 192.168.20.1 255.255.255.0
jiaoxue(config-if)#
bangong(config-if)#int f0/2
bangong(config-if)#switch mode trun
bangong(config-if)#int f0/3
bangong(config-if)#swit mode trun
bangong(config-if)#int f0/4
bangong(config-if)#swit mode trun
bangong(config)#int f0/1
bangong(config-if)#no switchport
bangong(config-if)#ip add 192.168.255.14 255.255.255.252
bangong(config-if)#exi
bangong(config)#exi
%SYS-5-CONFIG_I: Configured from console by console
bangong#wr
Building configuration...
[OK]
bangong#
config
ip routing
router ospf 1
network 192.168.18.0 0.0.0.255 area 0
network 192.168.19.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
network 192.168.255.12 0.0.0.3 area 0
教学楼汇聚交换机
Switch>en
Switch#config
Switch(config)#host jiaoxue
jiaoxue(config)#end
jiaoxue#vlan database
jiaoxue(vlan)#vtp domain jiaoxue
jiaoxue(vlan)#vtp password jiaoxue
Setting device VLAN database password to jiaoxue
jiaoxue(vlan)#vtp server
Device mode already VTP SERVER.
jiaoxue(vlan)#vlan 11
VLAN 11 added:
Name: VLAN0011
jiaoxue(vlan)#vlan 12
VLAN 12 added:
Name: VLAN0012
jiaoxue(vlan)#vlan 13
VLAN 13 added:
Name: VLAN0013
jiaoxue(vlan)#vlan 14
VLAN 14 added:
Name: VLAN0014
jiaoxue(vlan)#vlan 15
VLAN 15 added:
Name: VLAN0015
jiaoxue(vlan)#vlan 16
VLAN 16 added:
Name: VLAN0016
jiaoxue(vlan)#exit
APPLY completed.
Exiting....
jiaoxue#
jiaoxue#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
jiaoxue(config)#int vlan 11
jiaoxue(config-if)#ip address 192.168.11.1 255.255.255.0
jiaoxue(config-if)#int vlan 12
jiaoxue(config-if)#ip address 192.168.12.1 255.255.255.0
jiaoxue(config-if)#int vlan 13
jiaoxue(config-if)#ip address 192.168.13.1 255.255.255.0
jiaoxue(config-if)#int vlan 14
jiaoxue(config-if)#ip address 192.168.14.1 255.255.255.0
jiaoxue(config-if)#
jiaoxue(config-if)#ip address 192.168.14.1 255.255.255.0
jiaoxue(config-if)#int vlan 15
jiaoxue(config-if)#ip address 192.168.15.1 255.255.255.0
jiaoxue(config-if)#int vlan 16
jiaoxue(config-if)#ip address 192.168.16.1 255.255.255.0
jiaoxue(config-if)#end
jiaoxue#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
jiaoxue(config)#int f0/2
jiaoxue(config-if)#switchport mode trunk
jiaoxue(config-if)#int f0/3
jiaoxue(config-if)#switchport mode trunk
jiaoxue(config-if)#int f0/4
jiaoxue(config-if)#switchport mode trunk
jiaoxue(config)#int f0/1
jiaoxue(config-if)#no switchport
jiaoxue(config-if)#ip add 192.168.255.10 255.255.255.252
config
ip routing
router ospf 1
network 192.168.11.0 0.0.0.255 area 0
network 192.168.12.0 0.0.0.255 area 0
network 192.168.13.0 0.0.0.255 area 0
network 192.168.14.0 0.0.0.255 area 0
network 192.168.15.0 0.0.0.255 area 0
network 192.168.16.0 0.0.0.255 area 0
network 192.168.255.8 0.0.0.3 area 0
核心交换机
Switch>en
Switch#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname hexin
hexin(config)#no ip domain-lookup
hexin(config)#int f0/1
hexin(config-if)#no switchport
hexin(config-if)#ip add 192.168.255.6 255.255.255.252
hexin(config-if)#int f0/2
hexin(config-if)#no switchport
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
hexin(config-if)#ip add 192.168.255.9 255.255.255.252
hexin(config-if)#int f0/3
hexin(config-if)#no switchport
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
hexin(config-if)#ip add 192.168.255.13 255.255.255.252
hexin(config-if)#int f0/4
hexin(config-if)#no switchport
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down
hexin(config-if)#ip add 192.168.0.1 255.255.255.252
hexin(config-if)#exit
config
ip routing
router ospf 1
network 192.168.255.8 0.0.0.3 area 0
network 192.168.255.12 0.0.0.3 area 0
s5 s6 配置与s4类似此处省略
R1 R2 只需配置好每个端口ip然后配置ospf协议,端口ip和路由协议配置与核心交换机类似此处省略。
总结
1.题目要求可扩展的局域网组建
实验过程用了vtp
vtp是思科私有协议,若扩展使用别的厂商设备如华为就达不到可扩展性的要求
其实完全可以自己手工划分下vlan,使用vtp只是为了方便
2.使用三层交换的时候记得两条条命令
ip routing
和no shut
我在配置了ospf协议后彼此之间学习不到路由信息
郁闷了半天才发现忘了ip routing 来启用三层交换的路由功能