OSPF+RIP+VRRP+端口汇聚综合拓扑

OSPF+RIP+VRRP+端口汇聚综合实验

拓扑图

在这里插入图片描述

配置文件

R1

sysname R1
#
interface GigabitEthernet0/0/0
ip address 202.10.102.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 202.10.101.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
ip route-static 192.168.0.0 255.255.0.0 202.10.101.2

R2

sysname R2
#
acl number 2000
rule 5 permit source 192.168.0.0 0.0.255.255
#
interface GigabitEthernet0/0/0
ip address 202.10.101.2 255.255.255.0
nat outbound 2000
#
interface GigabitEthernet0/0/1
ip address 192.168.15.2 255.255.255.0
#
interface GigabitEthernet1/0/0
ip address 192.168.16.2 255.255.255.0
#
interface GigabitEthernet2/0/0
ip address 192.168.10.2 255.255.255.0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
ospf 110 router-id 2.2.2.2
default-route-advertise always cost 0
area 0.0.0.0
network 2.2.2.2 0.0.0.0
network 192.168.10.0 0.0.0.255
network 192.168.15.0 0.0.0.255
network 192.168.16.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 202.10.101.1

R3

sysname R3
#
interface GigabitEthernet0/0/0
ip address 192.168.10.3 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.20.3 255.255.255.0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 110 router-id 3.3.3.3
import-route rip 1 cost 100
area 0.0.0.0
network 3.3.3.3 0.0.0.0
network 192.168.10.0 0.0.0.255
#
rip 1
undo summary
default-route originate
version 2
network 3.0.0.0
network 192.168.20.0
import-route ospf 110 cost 0

R4

sysname R4
#
interface GigabitEthernet0/0/0
ip address 192.168.20.4 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.30.4 255.255.255.0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
rip 1
undo summary
version 2
network 4.0.0.0
network 192.168.20.0
network 192.168.30.0

R5

sysname R5
#
interface GigabitEthernet0/0/0
ip address 192.168.30.5 255.255.255.0
#
interface GigabitEthernet0/0/1.1
dot1q termination vid 500
ip address 192.168.5.1 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/1.2
dot1q termination vid 600
ip address 192.168.6.1 255.255.255.0
arp broadcast enable
#
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
#
rip 1
undo summary
version 2
network 5.0.0.0
network 192.168.30.0
network 192.168.5.0
network 192.168.6.0

SW1

不需要配置

SW2

#

sysname SW2
#
vlan batch 100 200 300 400 555
#
stp instance 1 root primary
stp instance 2 root secondary
#
interface Vlanif100
ip address 192.168.1.10 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
vrrp vrid 1 priority 105
vrrp vrid 1 track interface GigabitEthernet0/0/1
#
interface Vlanif200
ip address 192.168.2.10 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
vrrp vrid 2 track interface GigabitEthernet0/0/1
#
interface Vlanif300
ip address 192.168.3.10 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
vrrp vrid 3 priority 105
#
interface Vlanif400
ip address 192.168.4.10 255.255.255.0
vrrp vrid 4 virtual-ip 192.168.4.1
#
interface Vlanif555
ip address 192.168.15.10 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 555
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
eth-trunk 1
#
interface GigabitEthernet0/0/6
eth-trunk 1
#
interface GigabitEthernet0/0/7
eth-trunk 1
#
ospf 110
area 0.0.0.0
network 192.168.15.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
network 192.168.3.0 0.0.0.255
network 192.168.4.0 0.0.0.255

SW3

sysname SW3
#
vlan batch 100 200 300 400 666
#
stp instance 1 root secondary
stp instance 2 root primary
#
interface Vlanif100
ip address 192.168.1.11 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.1
#
interface Vlanif200
ip address 192.168.2.11 255.255.255.0
vrrp vrid 2 virtual-ip 192.168.2.1
vrrp vrid 2 priority 105
#
interface Vlanif300
ip address 192.168.3.11 255.255.255.0
vrrp vrid 3 virtual-ip 192.168.3.1
vrrp vrid 3 track interface GigabitEthernet0/0/1
#
interface Vlanif400
ip address 192.168.4.11 255.255.255.0
vrrp vrid 4 virtual-ip 192.168.4.1
vrrp vrid 4 priority 105
vrrp vrid 4 track interface GigabitEthernet0/0/1
#
interface Vlanif666
ip address 192.168.16.10 255.255.255.0
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 666
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
eth-trunk 1
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/5
eth-trunk 1
#
interface GigabitEthernet0/0/6
eth-trunk 1
#
interface GigabitEthernet0/0/7
eth-trunk 1
#
ospf 110
area 0.0.0.0
network 192.168.16.0 0.0.0.255
network 192.168.4.0 0.0.0.255
network 192.168.3.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255

SW4

sysname SW4
#
vlan batch 100 200 555
#
interface Ethernet0/0/1
port link-type access
port default vlan 100
#
interface Ethernet0/0/2
port link-type access
port default vlan 200
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094

SW5

sysname SW5
#
vlan batch 300 400 666
#
interface Ethernet0/0/1
port link-type access
port default vlan 300
#
interface Ethernet0/0/2
port link-type access
port default vlan 400
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094

SW6

sysname SW6
#
vlan batch 500 600
#
interface Ethernet0/0/1
port hybrid pvid vlan 500
port hybrid untagged vlan 2 to 4094
#
interface Ethernet0/0/2
port hybrid pvid vlan 600
port hybrid untagged vlan 2 to 4094
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094

实验验证

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值