三层架构实验

本文详细描述了在四台交换机上配置RIP协议、VLAN、以太网中继、STP、VRRP以及DHCP的过程,包括定义主根和副根,解决SW1和SW2之间的通讯问题,以及为PC配置IP地址和DNS服务器。
摘要由CSDN通过智能技术生成

SW1

[SW2]vlan 98
[SW2-vlan98]q
[SW2]interface Vlanif 98
[SW2-Vlanif98]ip address 192.168.2.2 24
[SW2-Vlanif98]q
[SW2]interface Ethernet0/0/1
[SW2-Ethernet0/0/1]port link-type access 
[SW2-Ethernet0/0/1]port default vlan 98

SW2

[SW2]vlan 98
[SW2-vlan98]q
[SW2]interface Vlanif 98
[SW2-Vlanif98]ip address 192.168.2.2 24
[SW2-Vlanif98]q
[SW2]interface Ethernet0/0/1
[SW2-Ethernet0/0/1]port link-type access 
[SW2-Ethernet0/0/1]port default vlan 98

SW1和SW2通讯问题 用RIP协议

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0 
[R1-rip-1]network 192.168.2.0

[SW1]rip 1
[SW1-rip-1]version 2
[SW1-rip-1]network 192.168.1.0        

[SW2]rip 1
[SW2-rip-1]version 2
[SW2-rip-1]network 192.168.2.0

以太网中继技术

[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]q
[SW1]interface Ethernet0/0/2
[SW1-Ethernet0/0/2]eth-trunk 0
[SW1-Ethernet0/0/2]interface Ethernet0/0/3
[SW1-Ethernet0/0/3]eth-trunk 0
[SW1-Ethernet0/0/3]q
[SW1]interface Eth-Trunk 0
[SW1-Eth-Trunk0]port link-type trunk 
[SW1-Eth-Trunk0]port trunk allow-pass vlan all

SW2同样的配置

将PC2和PC4分别划入SW3和SW4中的vlan2中

[SW3]vlan 2
[SW3-vlan2]q
[SW3]interface Ethernet0/0/4
[SW3-Ethernet0/0/4]port link-type access 
[SW3-Ethernet0/0/4]port default vlan 2        

[SW4]vlan 2
[SW4]interface Ethernet0/0/4
[SW4-Ethernet0/0/4]port link-type access 
[SW4-Ethernet0/0/4]port default vlan 2

将剩余8个接口都划入到trunk中

[SW1]interface Ethernet0/0/4
[SW1-Ethernet0/0/4]port link-type trunk 
[SW1-Ethernet0/0/4]port trunk allow-pass vlan all
[SW1-Ethernet0/0/4]interface Ethernet0/0/5
[SW1-Ethernet0/0/5]port link-type trunk
[SW1-Ethernet0/0/5]port trunk allow-pass vlan all

在四台Switch上启用STP协议

[SW1]vlan 2
[SW1-vlan2]q
[SW1]stp enable
[SW1]stp mode mstp 
[SW1]stp region-configuration 
[SW1-mst-region]region-name a
[SW1-mst-region]instance 1 vlan 1
[SW1-mst-region]instance 2 vlan 2
[SW1-mst-region]active region-configuration 

其余四台switch同样的配置

定义主根和副根

[SW1]stp instance 1 root primary 
[SW1]stp instance 2 root secondary

[SW2]stp instance 1 root secondary 
[SW2]stp instance 2 root primary

进入VRRP网段沉余阶段

[SW1]interface Vlanif 1
[SW1-Vlanif1]ip address 172.16.1.1 24

[SW2]interface Vlanif 2
[SW2-Vlanif2]ip address 172.16.1.2 24

[SW1]interface Vlanif 1
[SW1-Vlanif1]ip address 172.16.1.1 24
[SW1-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.250
[SW1-Vlanif1]vrrp vrid 1 priority 120
[SW1-Vlanif1]vrrp vrid 1 track interface Vlanif 99 reduced 30

[SW2]interface Vlanif 1
[SW2-Vlanif1]vrrp vrid 1 virtual-ip 172.16.1.250

配置DHCP

[SW1]ip pool xixi
[SW1-ip-pool-xixi]network 172.16.1.0 mask 24
[SW1-ip-pool-xixi]gateway-list 172.16.1.250
[SW1-ip-pool-xixi]dns-list 8.8.8.8
[SW1-ip-pool-xixi]q
[SW1]dhcp enable 
[SW1]interface Vlanif 1
[SW1-Vlanif1]dhcp select global

[SW2]ip pool xixi
[SW2-ip-pool-xixi]network 172.16.1.0 mask 24
[SW2-ip-pool-xixi]gateway-list 172.16.1.250
[SW2-ip-pool-xixi]dns-list 8.8.8.8
[SW2-ip-pool-xixi]q
[SW2]dhcp enable 
[SW2]interface Vlanif 1
[SW2-Vlanif1]dhcp select global

解决用户核心通讯

[SW1]rip 1
[SW1-rip-1]version 2
[SW1-rip-1]network 172.16.0.0

[SW2]rip 1
[SW2-rip-1]version 2
[SW2-rip-1]network 172.16.0.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值