校园网设计实验
·
实验一:校园网设计实验
拓扑图:

!!!📢注意
①每个人划分的vlan和ip地址不同,可以喂给ai让它换,我这个是绝对能配通的,换完就不知道了
ヾ(๑╹◡╹)ノ"
②感叹号一行为注释
③仅供参考,如有错误,欢迎指正
④原理在老师发的文件里有
实验目的:
(1)掌握VLAN创建和端口配置过程。
(2)掌握链路聚合配置过程。(channel)
(3)掌握三层交换机IP接口配置过程。(ip addr)
(4)掌握三层交换机OSPF配置过程。(router ospf)
回顾:
enable->en
configure terminal->conf t
interface->int
ip address->ip addr
所以代码里有很多可以缩减的地方, 自己手敲可以缩减,复制另当别论了
MS9:
enable
configure terminal
hostname MS9
ip routing
vlan 2
vlan 4
vlan 6
vlan 8
vlan 10
vlan 11
vlan 12
vlan 13
exit
! 连 MS6 (f0/1, f0/2) -> 通道组 1 (VLAN 11)
interface range f0/1 - 2
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 1 mode active
shutdown
no shutdown
exit
interface port-channel 1
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 连 MS7 (f0/3, f0/4) -> 通道组 2 (VLAN 12)
interface range f0/3 - 4
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 2 mode active
shutdown
no shutdown
exit
interface port-channel 2
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 连 MS8 (f0/5, f0/6) -> 通道组 3 (VLAN 13)
interface range f0/5 - 6
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 3 mode active
shutdown
no shutdown
exit
interface port-channel 3
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 互联 IP (SVI)
interface vlan 11
ip address 192.1.11.1 255.255.255.0
no shutdown
exit
interface vlan 12
ip address 192.1.12.1 255.255.255.0
no shutdown
exit
interface vlan 13
ip address 192.1.13.1 255.255.255.0
no shutdown
exit
! OSPF
router ospf 1
network 192.1.0.0 0.0.255.255 area 1
exit
end
write memory
MS6
enable
configure terminal
hostname MS6
ip routing
vlan 11
exit
! 连 MS9 (f0/1, f0/2)
interface range f0/1 - 2
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 1 mode active
shutdown
no shutdown
exit
interface port-channel 1
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 互联 IP
interface vlan 11
ip address 192.1.11.2 255.255.255.0
no shutdown
exit
! OSPF
router ospf 1
network 192.1.0.0 0.0.255.255 area 1
exit
end
write memory
MS7
enable
configure terminal
hostname MS7
ip routing
vlan 2
vlan 4
vlan 6
vlan 12
exit
! 连 MS9 (f0/1, f0/2)
interface range f0/1 - 2
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 2 mode active
shutdown
no shutdown
exit
interface port-channel 2
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 下联 Switch1, Switch2, Switch3 (f0/3, f0/4, f0/5)
interface range f0/3 - 5
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 互联 IP
interface vlan 12
ip address 192.1.12.2 255.255.255.0
no shutdown
exit
! 业务网关
interface vlan 2
ip address 192.1.2.254 255.255.255.0
no shutdown
exit
interface vlan 4
ip address 192.1.4.254 255.255.255.0
no shutdown
exit
interface vlan 6
ip address 192.1.6.254 255.255.255.0
no shutdown
exit
! OSPF
router ospf 1
network 192.1.0.0 0.0.255.255 area 1
exit
end
write memory
MS8
enable
configure terminal
hostname MS8
ip routing
vlan 8
vlan 10
vlan 13
exit
! 连 MS9 (f0/1, f0/2)
interface range f0/1 - 2
switchport trunk encapsulation dot1q
channel-protocol lacp
channel-group 3 mode active
shutdown
no shutdown
exit
interface port-channel 3
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 下联 Switch4, Switch5 (f0/3, f0/4)
interface range f0/3 - 4
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
exit
! 互联 IP
interface vlan 13
ip address 192.1.13.2 255.255.255.0
no shutdown
exit
! 业务网关
interface vlan 8
ip address 192.1.8.254 255.255.255.0
no shutdown
exit
interface vlan 10
ip address 192.1.10.254 255.255.255.0
no shutdown
exit
! OSPF
router ospf 1
network 192.1.0.0 0.0.255.255 area 1
exit
end
write memory
Switch1
enable
configure terminal
hostname Switch1
vlan 2
exit
interface f0/1
switchport mode trunk
no shutdown
exit
interface range f0/2 - 10
switchport mode access
switchport access vlan 2
no shutdown
exit
end
write memory
Switch2
enable
configure terminal
hostname Switch2
vlan 4
exit
interface f0/1
switchport mode trunk
no shutdown
exit
interface range f0/2 - 10
switchport mode access
switchport access vlan 4
no shutdown
exit
end
write memory
Switch3
enable
configure terminal
hostname Switch3
vlan 6
exit
interface f0/1
switchport mode trunk
no shutdown
exit
interface range f0/2 - 10
switchport mode access
switchport access vlan 6
no shutdown
exit
end
write memory
Switch4
enable
configure terminal
hostname Switch4
vlan 8
exit
interface f0/1
switchport mode trunk
no shutdown
exit
interface range f0/2 - 10
switchport mode access
switchport access vlan 8
no shutdown
exit
end
write memory
Switch5
enable
configure terminal
hostname Switch5
vlan 10
exit
interface f0/1
switchport mode trunk
no shutdown
exit
interface range f0/2 - 10
switchport mode access
switchport access vlan 10
no shutdown
exit
end
write memory
测试:
MS9:
show ip ospf neighbor
结果:

MS6-7:
show ip route
结果:
MS6:

MS7:

MS8:

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐



所有评论(0)