vXlan 小实验1 同网段通讯
拓扑及规划:
CE1 地址为10.0.12.1/24,10.0.13.1/24,1.1.1.1 , 宣告进ospf,bgp as-number 10,与ce2 ce3 建立bgp v4 邻居
CE2 CE3 类似
step 1:
接口配置地址,ospf ,bgp 配置完毕
[ce1]disp ospf pe b OSPF Process 1 with Router ID 10.0.12.1 Peer Statistic Information Total number of peer(s): 2 Peer(s) in full state: 2 ----------------------------------------------------------------------------- Area Id Interface Neighbor id State 0.0.0.0 GE1/0/0 10.0.12.2 Full 0.0.0.0 GE1/0/1 10.0.13.1 Full ----------------------------------------------------------------------------- [ce1]disp bgp pe BGP local router ID : 10.0.12.1 Local AS number : 10 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2.2.2.2 4 10 3 3 0 00:00:30 Established 0 3.3.3.3 4 10 3 4 0 00:00:17 Established 0
step 2:配置bgp evpn
# CE1
evpn-overlay enable
bgp 10
peer 2.2.2.2 as-number 10
peer 2.2.2.2 connect-interface LoopBack0
peer 3.3.3.3 as-number 10
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
peer 2.2.2.2 enable
peer 3.3.3.3 enable
#
l2vpn-family evpn
undo policy vpn-target
peer 2.2.2.2 enable
peer 2.2.2.2 reflect-client
peer 3.3.3.3 enable
peer 3.3.3.3 reflect-client
#CE2,CE3:
evpn-overlay enable
bgp 10
peer 1.1.1.1 as-number 10
peer 1.1.1.1 connect-interface LoopBack0
#
ipv4-family unicast
peer 1.1.1.1 enable
#
l2vpn-family evpn
policy vpn-target
peer 1.1.1.1 enable
[CE1]disp bgp evpn peer BGP local router ID : 1.1.1.1 Local AS number : 10 Total number of peers : 2 Peers in established state : 2 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 2.2.2.2 4 10 13 14 0 00:08:32 Established 0 3.3.3.3 4 10 12 12 0 00:07:12 Established
step 3:创建BD,指定VNI, VRF RD,RT
[CE2] bridge-domain 20
[CE2-bd20] vxlan vni 5020
[CE2-bd20] evpn
[CE2-bd20-evpn] route-distinguisher 10:1
[CE2-bd20-evpn] vpn-target 100:5020
interface Vbdif20
ip address 10.0.10.254 255.255.255.0
arp proxy anyway enable
//proxy arp
step 4:头端复制使用bgp
[CE2] interface nve 1 [CE2-Nve1] source 1.1.1.1 [CE2-Nve1] vni 5020 head-end peer-list protocol bgp
step 5: 配置接入vxlan
# CE2: interface GE1/0/1.10 mode l2 encapsulation dot1q vid 10 to 30 bridge-domain 20 # CE3: interface GE1/0/1.20 mode l2 encapsulation dot1q vid 10 bridge-domain 20
step 6: 查看bgp evpn peer/路由表, vxlan 隧道/peer, evpn 实例
[CE1]disp bgp evpn peer BGP local router ID : 1.1.1.1 Local AS number : 10 Total number of peers : 2 Peers in established state : 2
[CE2]disp bgp evpn peer BGP local router ID : 2.2.2.2 Local AS number : 10 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 1.1.1.1 4 10 113 114 0 01:32:01 Established 1 [CE2]disp evpn vpn-instance Total EVPN-Instances configured : 1 EVPN-Instance Name RD Address-family 20 10:1 evpn [CE2]disp vxlan peer Number of peers : 1 Vni ID Source Destination Type Out Vni ID ------------------------------------------------------------------------------- 5020 2.2.2.2 3.3.3.3 dynamic 5020 [CE2]disp vxlan tunnel Number of vxlan tunnel : 1 Tunnel ID Source Destination State Type Uptime ----------------------------------------------------------------------------------- 4026531841 2.2.2.2 3.3.3.3 up dynamic 00:19:27
[CE1]disp bgp evpn all routing-table Local AS number : 10 BGP Local router ID is 1.1.1.1 Status codes: * - valid, > - best, d - damped, x - best external, a - add path, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete EVPN address family: Number of Mac Routes: 1 Route Distinguisher: 10:1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *>i 0:48:707b-e820-636a:0:0.0.0.0 2.2.2.2 // CE2 vbdif mac EVPN address family: Number of Inclusive Multicast Routes: 2 Route Distinguisher: 10:1 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *>i 0:32:2.2.2.2 2.2.2.2 *>i 0:32:3.3.3.3
[CE3]disp bgp evpn all routing-table Local AS number : 10 BGP Local router ID is 3.3.3.3 Status codes: * - valid, > - best, d - damped, x - best external, a - add path, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete EVPN address family: Number of Mac Routes: 1 Route Distinguisher: 10:1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *>i 0:48:707b-e820-636a:0:0.0.0.0 2.2.2.2 EVPN-Instance 20: Number of Mac Routes: 1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *>i 0:48:707b-e820-636a:0:0.0.0.0 2.2.2.2 EVPN address family: Number of Inclusive Multicast Routes: 2 Route Distinguisher: 10:1 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *>i 0:32:2.2.2.2 2.2.2.2 *> 0:32:3.3.3.3 0.0.0.0 EVPN-Instance 20: Number of Inclusive Multicast Routes: 2 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *>i 0:32:2.2.2.2 2.2.2.2 *> 0:32:3.3.3.3
[CE2] disp bgp evpn all routing-table Local AS number : 10 BGP Local router ID is 2.2.2.2 Status codes: * - valid, > - best, d - damped, x - best external, a - add path, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete EVPN address family: Number of Mac Routes: 1 Route Distinguisher: 10:1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *> 0:48:707b-e820-636a:0:0.0.0.0 0.0.0.0 EVPN-Instance 20: Number of Mac Routes: 1 Network(EthTagId/MacAddrLen/MacAddr/IpAddrLen/IpAddr) NextHop *> 0:48:707b-e820-636a:0:0.0.0.0 0.0.0.0 EVPN address family: Number of Inclusive Multicast Routes: 2 Route Distinguisher: 10:1 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *> 0:32:2.2.2.2 0.0.0.0 *>i 0:32:3.3.3.3 3.3.3.3 EVPN-Instance 20: Number of Inclusive Multicast Routes: 2 Network(EthTagId/IpAddrLen/OriginalIp) NextHop *> 0:32:2.2.2.2 0.0.0.0 *>i 0:32:3.3.3.3
[CE2]disp int Vbdif 20
Vbdif20 current state : UP (ifindex: 19)
Line protocol current state : UP
Last line protocol up time : 2020-11-22 23:39:57
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.10.254/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 707b-e820-636a
Current system time: 2020-11-23 00:35:35
Last 300 seconds input rate 0 bits/sec, 0 packets/sec
Last 300 seconds output rate 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes
Output:0 packets, 0 bytes
Last 300 seconds input utility rate: --
Last 300 seconds output utility rate: --
<r1>ping 10.0.10.2 PING 10.0.10.2: 56 data bytes, press CTRL_C to break Reply from 10.0.10.2: bytes=56 Sequence=1 ttl=254 time=390 ms Reply from 10.0.10.2: bytes=56 Sequence=2 ttl=254 time=30 ms Reply from 10.0.10.2: bytes=56 Sequence=3 ttl=254 time=30 ms Reply from 10.0.10.2: bytes=56 Sequence=4 ttl=254 time=30 ms Reply from 10.0.10.2: bytes=56 Sequence=5 ttl=254 time=40 ms --- 10.0.10.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/104/390 ms <r1>ping 10.0.10.3 PING 10.0.10.3: 56 data bytes, press CTRL_C to break Reply from 10.0.10.3: bytes=56 Sequence=1 ttl=255 time=20 ms Reply from 10.0.10.3: bytes=56 Sequence=2 ttl=255 time=30 ms Reply from 10.0.10.3: bytes=56 Sequence=3 ttl=255 time=40 ms
ps : 不同vlan,不同vni,不同bd,都 可以通,只需要rt一致即可。抓包可见来回不同vni 不影响互通。