vrrp配置

vrrp配置
LSW6配置

vlan batch 10

cluster enable
ntdp enable
ndp enable

interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10

interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10

interface GigabitEthernet0/0/3

interface GigabitEthernet0/0/4

interface GigabitEthernet0/0/5

interface GigabitEthernet0/0/6
port link-type access
port default vlan 10

LSW3配置
sysname LSW3

vlan batch 10 20

interface Vlanif10
ip address 192.168.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254 配置虚拟网关
vrrp vrid 1 priority 120 配置优先级120,默认100,优先级越高权重越大
vrrp vrid 1 preempt-mode timer delay 20 配置抢占时间为20秒

interface Vlanif20
ip address 10.10.1.1 255.255.255.0

interface MEth0/0/1

interface GigabitEthernet0/0/1
shutdown
port link-type trunk
port trunk allow-pass vlan 10

interface GigabitEthernet0/0/2

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20

ospf 1
import-route direct
area 0.0.0.0
network 10.10.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
LSW4配置

interface Vlanif10
ip address 192.168.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.1.254

interface Vlanif30
ip address 10.10.2.1 255.255.255.0

interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10

interface GigabitEthernet0/0/3

interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 30

ospf 1
import-route direct 引入直连路由
area 0.0.0.0
network 10.10.2.0 0.0.0.255
network 192.168.1.0 0.0.0.255
LSW5配置

interface Vlanif20
ip address 10.10.1.2 255.255.255.0

interface Vlanif30
ip address 10.10.2.2 255.255.255.0

interface Vlanif50
ip address 172.16.10.1 255.255.255.0

interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 20

interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 30

interface GigabitEthernet0/0/5

interface GigabitEthernet0/0/6
port link-type access
port default vlan 50

ospf 1
import-route direct
area 0.0.0.0
network 172.16.10.0 0.0.0.255
network 10.10.1.0 0.0.0.255
network 10.10.2.0 0.0.0.255

测试
vrrp配置

中断一条线路 ping172.16.10.2 依旧可以通
vrrp配置