|
发表于 2005-1-15 20:05:19
|
显示全部楼层
Configuring Master VRRP routerFirst of all we should create a VRRP instance on this router. We will use the priority of 255 for thisrouter as it should be preferred router.[admin@MikroTik] ip vrrp> add interface=local priority=255[admin@MikroTik] ip vrrp> printFlags: X - disabled, I - invalid, M - master, B - backup0 M name="vr1" interface=local vrid=1 priority=255 interval=1preemption-mode=yes authentication=none password="" on-backup=""on-master=""[admin@MikroTik] ip vrrp>Next the virtual IP address should be added to this VRRP instance[admin@MikroTik] ip vrrp> address add address=192.168.1.1/24 \\... virtual-router=vr1[admin@MikroTik] ip vrrp> address printFlags: X - disabled, A - active# ADDRESS NETWORK BROADCAST VIRTUAL-ROUTER0 192.168.1.1/24 192.168.1.0 192.168.1.255 vr1[admin@MikroTik] ip vrrp>Now this address should appear in /ip address list:[admin@MikroTik] ip address> printFlags: X - disabled, I - invalid, D - dynamic# ADDRESS NETWORK BROADCAST INTERFACE0 10.0.0.1/24 10.0.0.0 10.0.0.255 public1 192.168.1.2/24 192.168.1.0 192.168.1.255 local2 D 192.168.1.1/24 192.168.1.0 192.168.1.255 local[admin@MikroTik] ip address>Configuring Backup VRRP routerNow we will create VRRP instance with lower priority (we can use the default value of 100), so thisrouter will back up the preferred one:[admin@MikroTik] ip vrrp> add interface=local[admin@MikroTik] ip vrrp> printFlags: X - disabled, I - invalid, M - master, B - backup0 B name="vr1" interface=local vrid=1 priority=100 interval=1preemption-mode=yes authentication=none password="" on-backup=""on-master=""[admin@MikroTik] ip vrrp>Now we should add the same virtual address as was added to the master node:Page 283 of 564[admin@MikroTik] ip vrrp> address add address=192.168.1.1/24 \\... virtual-router=vr1[admin@MikroTik] ip vrrp> address printFlags: X - disabled, A - active# ADDRESS NETWORK BROADCAST VIRTUAL-ROUTER0 192.168.1.1/24 192.168.1.0 192.168.1.255 vr1[admin@MikroTik] ip vrrp>Note that this address will not appear in /ip address list:[admin@MikroTik] ip address> printFlags: X - disabled, I - invalid, D - dynamic# ADDRESS NETWORK BROADCAST INTERFACE0 10.1.0.1/24 10.0.0.0 10.0.0.255 public1 192.168.1.3/24 192.168.1.0 192.168.1.255 local[admin@MikroTik] ip address>Testing fail overNow, when we will disconnect the master router, the backup one will switch to the master state:[admin@MikroTik] ip vrrp> printFlags: X - disabled, I - invalid, M - master, B - backup0 M name="vr1" interface=local vrid=1 priority=100 interval=1preemption-mode=yes authentication=none password="" on-backup=""on-master=""[admin@MikroTik] ip vrrp> /ip address printFlags: X - disabled, I - invalid, D - dynamic# ADDRESS NETWORK BROADCAST INTERFACE0 10.1.0.1/24 10.0.0.0 10.0.0.255 public1 192.168.1.3/24 192.168.1.0 192.168.1.255 local2 D 192.168.1.1/24 192.168.1.0 192.168.1.255 local[admin@MikroTik] ip vrrp> |
|