配置Dot1q终结子接口支持BFD示例
本示例中,通过配置Dot1q终结子接口支持BFD后,保证传输带有一层Tag报文的链路的可靠性和稳定性。
组网需求
如图3-12所示,VLAN10的用户通过缺省网关访问ISP网络。其中,DeviceA的GE0/2/0.1为Dot1q终结子接口,DeviceB的GE0/2/0.1为Dot1q终结子接口。
在DeviceA和DeviceB上配置BFD会话,检测设备之间的链路。
在DeviceA上配置VRRP备份组1,使其为Master设备;在DeviceB上配置VRRP备份组1,使其为Backup设备。
分别在DeviceA和DeviceB上配置VRRP备份组1监视BFD会话。
配置思路
采用如下的思路配置Dot1q终结子接口支持BFD的基本功能:
配置IGP,使得DeviceA、DeviceB和DeviceC设备之间可以互通。
配置Switch二层转发功能。
配置DeviceA和DeviceB的Dot1q终结子接口。
在DeviceA和DeviceB上创建BFD会话,检测DeviceA和DeviceB之间的链路。
分别在DeviceA和DeviceB的GE0/2/0.1接口上创建VRRP备份组1,确保DeviceA为Master设备,DeviceB为Backup设备。
操作步骤
- 配置设备之间的网络互连
如图3-12所示,配置各设备接口的IP地址。配置DeviceA、DeviceB和DeviceC之间的IGP,本例采用OSPF。
# 配置DeviceA。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceA
[*HUAWEI] commit
[~DeviceA] interface gigabitethernet 0/1/0
[~DeviceA-GigabitEthernet0/1/0] undo shutdown
[*DeviceA-GigabitEthernet0/1/0] ip address 192.168.2.1 24
[*DeviceA-GigabitEthernet0/1/0] quit
[*DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceA-GigabitEthernet0/2/0.1] ip address 10.1.1.1 24
[*DeviceA-GigabitEthernet0/2/0.1] quit
[*DeviceA] ospf 1
[*DeviceA-ospf-1] area 0
[*DeviceA-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceA-ospf-1-area-0.0.0.0] commit
[~DeviceA-ospf-1-area-0.0.0.0] quit
[~DeviceA-ospf-1] quit
# 配置DeviceB。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceB
[*HUAWEI] commit
[~DeviceB] interface gigabitethernet 0/1/0
[*DeviceB-GigabitEthernet0/1/0] undo shutdown
[*DeviceB-GigabitEthernet0/1/0] ip address 192.168.1.1 24
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] undo shutdown
[*DeviceB-GigabitEthernet0/2/0.1] ip address 10.1.1.2 24
[*DeviceB-GigabitEthernet0/2/0.1] quit
[*DeviceB] ospf 1
[*DeviceB-ospf-1] area 0
[*DeviceB-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[*DeviceB-ospf-1-area-0.0.0.0] commit
[~DeviceB-ospf-1-area-0.0.0.0] quit
[~DeviceB-ospf-1] quit
# 配置DeviceC。
<HUAWEI> system-view
[~HUAWEI] sysname DeviceC
[*HUAWEI] commit
[~DeviceC] interface gigabitethernet 0/1/0
[~DeviceC-GigabitEthernet0/1/0] undo shutdown
[*DeviceC-GigabitEthernet0/1/0] ip address 192.168.2.2 24
[*DeviceC-GigabitEthernet0/1/0] quit
[*DeviceC] interface gigabitethernet 0/2/0
[*DeviceC-GigabitEthernet0/2/0] undo shutdown
[*DeviceC-GigabitEthernet0/2/0] ip address 192.168.1.2 24
[*DeviceC-GigabitEthernet0/2/0] quit
[*DeviceC] ospf 1
[*DeviceC-ospf-1] area 0
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.1.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] network 192.168.2.0 0.0.0.255
[*DeviceC-ospf-1-area-0.0.0.0] commit
[~DeviceC-ospf-1-area-0.0.0.0] quit
[~DeviceC-ospf-1] quit
配置完成后,DeviceA和DeviceB相互之间有OSPF协议发现到对端IP的路由,并能互相Ping通。
以DeviceA的显示为例。
<DeviceA> display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 7 Routes : 7 Destination/Mask Proto Pre Cost Flags NextHop Interface 192.168.2.0/24 Direct 0 0 D 192.168.2.1 GigabitEthernet0/1/0 192.168.2.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.0/24 OSPF 10 2 D 192.168.2.2 GigabitEthernet0/1/0 10.1.1.0/24 Direct 0 0 D 10.1.1.1 GigabitEthernet0/2/0.1 10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[~DeviceA] ping 192.168.1.1
PING 192.168.1.1: 56 data bytes, press CTRL_C to break Reply from 192.168.1.1: bytes=56 Sequence=1 ttl=254 time=7 ms Reply from 192.168.1.1: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=3 ttl=254 time=5 ms Reply from 192.168.1.1: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 192.168.1.1: bytes=56 Sequence=5 ttl=254 time=8 ms --- 192.168.1.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/4/8 ms
- 配置Switch二层转发功能
<HUAWEI> system-view
[~HUAWEI] sysname Switch
[*HUAWEI] commit
[~Switch] vlan 10
[*Switch-vlan10] port gigabitethernet 0/1/0
[*Switch-vlan10] quit
[*Switch] interface gigabitethernet 0/1/1
[*Switch-GigabitEthernet0/1/1] undo shutdown
[*Switch-GigabitEthernet0/1/1] port trunk allow-pass vlan 10
[*Switch-GigabitEthernet0/1/1] quit
[*Switch] interface gigabitethernet 0/1/2
[*Switch-GigabitEthernet0/1/2] undo shutdown
[*Switch-GigabitEthernet0/1/2] port trunk allow-pass vlan 10
[*Switch-GigabitEthernet0/1/2] commit
[~Switch-GigabitEthernet0/1/2] quit
- 配置Dot1q终结子接口
# 配置DeviceA。
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] control-vid 1 dot1q-termination
[*DeviceA-GigabitEthernet0/2/0.1] dot1q termination vid 10
[*DeviceA-GigabitEthernet0/2/0.1] commit
# 配置DeviceB。
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] control-vid 1 dot1q-termination
[*DeviceB-GigabitEthernet0/2/0.1] dot1q termination vid 10
[*DeviceB-GigabitEthernet0/2/0.1] commit
- 配置BFD会话
# 配置DeviceA。
[~DeviceA] bfd
[*DeviceA-bfd] quit
[*DeviceA] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceA-bfd-session-atob] discriminator local 1
[*DeviceA-bfd-session-atob] discriminator remote 2
[*DeviceA-bfd-session-atob] dot1q vid 10
[*DeviceA-bfd-session-atob] commit
[~DeviceA-bfd-session-atob] quit
# 配置DeviceB。
[~DeviceB] bfd
[*DeviceB-bfd] quit
[*DeviceB] bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1
[*DeviceB-bfd-session-atob] discriminator local 2
[*DeviceB-bfd-session-atob] discriminator remote 1
[*DeviceB-bfd-session-atob] dot1q vid 10
[*DeviceB-bfd-session-atob] commit
[~DeviceB-bfd-session-atob] quit
完成配置后,执行display bfd session all verbose命令,可以查看到BFD会话的状态为Up。以DeviceA的显示为例。
[~DeviceA] display bfd session all verbose
(w): State in WTR (*): State is invalid -------------------------------------------------------------------------------- (One Hop) State : UP Name : atob -------------------------------------------------------------------------------- Local Discriminator : 1 Remote Discriminator : 2 Session Detect Mode : Asynchronous Mode Without Echo Function BFD Bind Type : Interface(0/2/0) Bind Session Type : Static Bind Peer IP Address : 10.1.1.2 Bind Interface : 0/2/0 Vid : 10 FSM Board Id : 6 TOS-EXP : 7 Min Tx Interval (ms) : 10 Min Rx Interval (ms) : 10 Actual Tx Interval (ms): 10 Actual Rx Interval (ms): 10 Local Detect Multi : 50 Detect Interval (ms) : 500 Echo Passive : Disable Acl Number : - Destination Port : 3784 TTL : 255 Proc Interface Status : Disable Process PST : Disable WTR Interval (ms) : - Config PST : Disable Active Multi : 50 Last Local Diagnostic : No Diagnostic Bind Application : No Application Bind Session TX TmrID : - Session Detect TmrID : - Session Init TmrID : - Session WTR TmrID : - Session Echo Tx TmrID : - Session Description : - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
- 配置VRRP备份组1监视BFD会话
# 配置DeviceA。
[~DeviceA] interface gigabitethernet 0/2/0.1
[*DeviceA-GigabitEthernet0/2/0.1] dot1q vrrp vid 10
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual 10.1.1.100
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 priority 160
[*DeviceA-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 1
[*DeviceA-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceA-GigabitEthernet0/2/0.1] commit
[~DeviceA-GigabitEthernet0/2/0.1] quit
# 配置DeviceB。
[~DeviceB] interface gigabitethernet 0/2/0.1
[*DeviceB-GigabitEthernet0/2/0.1] dot1q vrrp vid 10
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 virtual 10.1.1.100
[*DeviceB-GigabitEthernet0/2/0.1] vrrp vrid 1 track bfd-session 2
[*DeviceB-GigabitEthernet0/2/0.1] arp broadcast enable
[*DeviceB-GigabitEthernet0/2/0.1] commit
[~DeviceB-GigabitEthernet0/2/0.1] quit
- 验证配置结果
执行display vrrp命令,可以查看到VRRP备份组监视的BFD会话的状态为Up。以DeviceA的显示为例。
[~DeviceA] display vrrp
GigabitEthernet0/1/0 | Virtual Device 1 State : Master Virtual IP : 10.1.1.100 Master IP : 192.168.2.1 Local IP : 192.168.2.1 PriorityRun : 160 PriorityConfig : 160 MasterPriority : 160 Preempt : YES Delay Time : 0s Hold Multiplier : 4 TimerRun : 1s TimerConfig : 1s Auth Type : NONE Virtual MAC : 00e0-fc12-7890 Check TTL : YES Config Type : normal-vrrp Backup-forward : disabled Track IF : GigabitEthernet0/1/0Priority Reduced :20 IF State : DOWN Track BFD : 0 Priority Reduced :10 BFD-Session State : UP Create Time : 2011-12-29 05:41:23 Last Change Time : 2011-12-29 05:41:33
配置文件
DeviceA的配置文件
# sysname DeviceA # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.1 24 # interface GigabitEthernet0/2/0 undo shutdown # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation dot1q-termination dot1q termination vid 10 dot1q vrrp vid 10 ip address 10.1.1.1 24 vrrp vrid 1 virtual 10.1.1.100 vrrp vrid 1 priority 160 vrrp vrid 1 track bfd-session 1 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 1 discriminator remote 2 dot1q vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.2.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
DeviceB的配置文件
# sysname DeviceB # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.1.1 24 # interface GigabitEthernet0/2/0 undo shutdown # interface GigabitEthernet0/2/0.1 undo shutdown encapsulation dot1q-termination dot1q termination vid 10 dot1q vrrp vid 10 ip address 10.1.1.2 24 vrrp vrid 1 virtual 10.1.1.100 vrrp vrid 1 track bfd-session 2 arp broadcast enable # bfd atob bind peer-ip default-ip interface gigabitethernet 0/2/0.1 discriminator local 2 discriminator remote 1 dot1q vid 10 commit # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 10.1.1.0 0.0.0.255 # return
DeviceC的配置文件
# sysname DeviceC # bfd # interface GigabitEthernet 0/1/0 undo shutdown ip address 192.168.2.2 24 # interface GigabitEthernet 0/2/0 undo shutdown ip address 192.168.1.2 24 # ospf 1 area 0.0.0.0 network 192.168.1.0 0.0.0.255 network 192.168.2.0 0.0.0.255 # return
Switch的配置文件
# sysname Switch # vlan batch 10 # interface GigabitEthernet0/1/0 undo shutdown port default vlan 10 # interface GigabitEthernet0/1/1 undo shutdown port trunk allow-pass vlan 10 # interface GigabitEthernet0/1/2 undo shutdown port trunk allow-pass vlan 10 # return