1、网络拓扑图
2、核心:vrrp知识点
1)虚拟ip地址
vrrp vrid 1 virtual-IP 10.1.1.254
虚拟地址为:10.1.1.254
虚拟mac:0000-5e00-01xx
xx表示组号,此实例中为01
2)虚拟默认优先级为100,范围在0-255
vrrp vrid 1 priority 120
需改优先级为120
3)延时切换,默认时间为0
vrrp vrid 1 preempt-mode timer delay 30
设置延时切换为30s,防止数据丢失,
4)接口跟踪
vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30
当跟踪接口出现故障后,优先级值减30,变为90
3、详细配置
sw1:
[sw1]display current-configuration
#
sysname sw1
#
vlan batch 10 20 30 40
#
stp instance 1 root primary
stp instance 2 root secondary
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
region-name gd
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 30
vrrp vrid 1 track interface GigabitEthernet0/0/5 reduced 30
#
interface Vlanif20
ip address 10.1.2.2 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.2.254
#
interface Vlanif30
ip address 10.1.3.1 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
eth-trunk 1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
eth-trunk 1
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ospf 100 router-id 2.2.2.2
import-route direct
area 0.0.0.0
network 10.1.3.0 0.0.0.255
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
[sw1]
sw2:
[sw2]display current-configuration
#
sysname sw2
#
vlan batch 10 20 30 40
#
stp instance 1 root secondary
stp instance 2 root secondary
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
stp region-configuration
region-name gd
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.254
#
interface Vlanif20
ip address 10.1.2.1 255.255.255.0
vrrp vrid 2 virtual-ip 10.1.2.254
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 30
vrrp vrid 2 track interface GigabitEthernet0/0/5 reduced 30
#
interface Vlanif40
ip address 10.1.4.1 255.255.255.0
#
interface MEth0/0/1
#
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
eth-trunk 1
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/4
eth-trunk 1
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 40
#
interface GigabitEthernet0/0/6
#
interface GigabitEthernet0/0/7
#
interface GigabitEthernet0/0/8
#
interface GigabitEthernet0/0/9
#
interface GigabitEthernet0/0/10
#
interface GigabitEthernet0/0/11
#
interface GigabitEthernet0/0/12
#
interface GigabitEthernet0/0/13
#
interface GigabitEthernet0/0/14
#
interface GigabitEthernet0/0/15
#
interface GigabitEthernet0/0/16
#
interface GigabitEthernet0/0/17
#
interface GigabitEthernet0/0/18
#
interface GigabitEthernet0/0/19
#
interface GigabitEthernet0/0/20
#
interface GigabitEthernet0/0/21
#
interface GigabitEthernet0/0/22
#
interface GigabitEthernet0/0/23
#
interface GigabitEthernet0/0/24
#
interface NULL0
#
ospf 100 router-id 3.3.3.3
import-route direct
area 0.0.0.0
network 10.1.4.0 0.0.0.255
#
user-interface con 0
idle-timeout 0 0
user-interface vty 0 4
#
return
[sw2]
r1:
[r1]display current-configuration
[V200R003C00]
#
sysname r1
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
acl number 2000
rule 5 permit
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
nat address-group 1 100.1.1.10 100.1.1.200
#
interface GigabitEthernet0/0/0
ip address 10.1.3.2 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 10.1.4.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 100.1.1.2 255.255.255.0
nat outbound 2000 address-group 1
#
interface NULL0
#
ospf 100 router-id 1.1.1.1
default-route-advertise always type 1
area 0.0.0.0
network 10.1.3.0 0.0.0.255
network 10.1.4.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 100.1.1.1
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
[r1]