華為VRRP VLAN DHCP配置例項

2021-10-07 20:54:42 字數 4094 閱讀 8254

vrrp全稱為(virtual router redundancy protocol),即虛擬路由冗餘協議,簡單來說就是用於解決靜態閘道器單點故障的問題。可以把多台閘道器裝置合併為一台。使其中一台閘道器裝置down掉後,可以保證不會出現斷網現象。

拓撲結構圖:

配置需求:

ar1為邊界路由器

採用ospf動態路由協議網際網路段

sw1與sw2做vrrp虛擬閘道器

建立vlan 10 vlan20分割內網

vlan10 ip:192.168.1.0 /24

vlan20 ip: 192.168.2.0/24

虛擬閘道器:192.168.1.254/192.168.2.254

建立dhcp伺服器閘道器指向虛擬閘道器

作用:當sw1的下聯介面down掉時,sw2可立馬響應做為新閘道器,使內網網路不中斷

inte***ce gigabitethernet0/0/1 #配置介面位址

ip address 12.0.0.1 255.255.255.0

inte***ce loopback0 #配置環迴口位址

ip address 1.1.1.1 255.255.255.255

ospf 100 router-id 1.1.1.1 #設定ospf程序號為100,id為1.1.1.1

area 0.0.0.0 #設定為area0

network 1.1.1.1 0.0.0.0 #宣告環迴口

network 11.0.0.1 0.0.0.0 #宣告介面位址

network 12.0.0.1 0.0.0.0 #宣告介面位址

sw1:

sysname sw1 #設定此交換機名稱為sw1

vlan batch 10 20 30 #建立vlan 10 20 30

dhcp enable #啟用dhcp功能

ip pool dhcp2 #建立dhcp位址池,名字為dhcp2

gateway-list 192.168.2.254

network 192.168.2.0 mask 255.255.255.0

excluded-ip-address 192.168.2.250 192.168.2.253

dns-list 114.114.114.114 8.8.8.8

ip pool dncp1 #建立dhcp位址池,名字為dhcp1

gateway-list 192.168.1.254

network 192.168.1.0 mask 255.255.255.0

excluded-ip-address 192.168.1.250 192.168.1.253

dns-list 114.114.114.114 8.8.8.8

inte***ce vlanif10 #進入vlan10介面

ip address 192.168.1.1 255.255.255.0 #配置vlan10 ip

vrrp vrid 1 virtual-ip 192.168.1.254 #啟用vrrp設定為組1,虛擬ip為192.168.1.254

vrrp vrid 1 priority 150 #修改此路由vrrp組1的優先順序

dhcp select global #介面全域性啟用dhcp

inte***ce vlanif20

ip address 192.168.2.2 255.255.255.0

vrrp vrid 2 virtual-ip 192.168.2.254

dhcp select global

inte***ce vlanif30

ip address 11.0.0.2 255.255.255.0

inte***ce gigabitethernet0/0/23 #進入介面

port link-type trunk #介面模式改為trunk

port trunk allow-pass vlan 2 to 4094 #允許所有vlan通過

inte***ce gigabitethernet0/0/24

port link-type access #介面模式改為access

port default vlan 30 #介面繫結vlan 30

ospf 100 router-id 2.2.2.2

area 0.0.0.0

network 11.0.0.2 0.0.0.0

network 192.168.1.0 0.0.0.255

network 192.168.2.0 0.0.0.255

sw2:

sysname sw2

vlan batch 10 20 40

dhcp enable

ip pool dhcp1

gateway-list 192.168.1.254

network 192.168.1.0 mask 255.255.255.0

excluded-ip-address 192.168.1.250 192.168.1.253

dns-list 114.114.114.114 8.8.8.8

ip pool dhcp2

gateway-list 192.168.2.254

network 192.168.2.0 mask 255.255.255.0

excluded-ip-address 192.168.2.250 192.168.2.253

dns-list 114.114.114.114 8.8.8.8

inte***ce vlanif10

ip address 192.168.1.2 255.255.255.0

vrrp vrid 1 virtual-ip 192.168.1.254

dhcp select global

inte***ce vlanif20

ip address 192.168.2.1 255.255.255.0

vrrp vrid 2 virtual-ip 192.168.2.254

dhcp select global

inte***ce vlanif40

ip address 12.0.0.2 255.255.255.0

inte***ce gigabitethernet0/0/23

port link-type trunk

port trunk allow-pass vlan 2 to 4094

inte***ce gigabitethernet0/0/24

port link-type access

port default vlan 40

ospf 100 router-id 3.3.3.3

area 0.0.0.0

network 12.0.0.2 0.0.0.0

network 192.168.1.0 0.0.0.255

network 192.168.2.0 0.0.0.255

sw3:

sysname sw3

vlan batch 10 20

inte***ce ethernet0/0/1

port link-type access

port default vlan 10

inte***ce ethernet0/0/2

port link-type access

port default vlan 20

inte***ce gigabitethernet0/0/1

port link-type trunk

port trunk allow-pass vlan 2 to 4094

inte***ce gigabitethernet0/0/2

port link-type trunk

port trunk allow-pass vlan 2 to 4094

使用displady vrrp brief 可檢視vrrp的狀態

使用displady vrrp 可檢視vrrp詳細資訊

華為vrrp預設優先順序 乾貨 華為vrrp配置

實驗名稱 華為vrrp配置 實驗目的 為了實現路由器的冗餘即備份,當其中乙個三層交換機壞了,pc還能正常上網 實驗拓撲 sw3 配置步驟 思路 建立vlan10 20 30 40 01 02 03 04埠分別加入vlan10到40.05 06埠配置trunk模式允許所有vlan通過 huawei s...

華為Eudemon200防火牆透明模式配置一例

firewall mode transparent 將防火牆 定義為透明模式 firewall statistic system enable inte ce aux0 async mode flow link protocol ppp inte ce ethernet0 0 0 將介面e0 0 0...

利用expect指令碼實現備份華為交換機配置之 四

利用expect指令碼實現備份華為交換機配置之 四 為了方便管理,我們可以將windows共享資料夾掛在到linux下,以便讓備份的 資料能夠通過windows來隨時檢視,並制定相應的計畫任務讓指令碼自動執行。www.2cto.com 1.將windows共享掛載到 mnt share root g...