![]()
[root@evpn1 ~]# ip route sh vrf evpn-vrf2
default via 10.10.18.212 dev br100 proto bgp metric 20 onlink ----------------------访问同一个vtep上的2.2.2.2要经过10.10.18.212?
9.9.9.0/24 via 10.10.18.212 dev br100 proto bgp metric 20 onlink
192.168.3.0/24 dev br30 proto kernel scope link src 192.168.3.254
192.168.3.4 via 10.10.18.212 dev br1000 proto bgp metric 20 onlink
[root@evpn1 ~]# ip netns exec host3 ping 2.2.2.2
PING 2.2.2.2 (2.2.2.2) 56(84) bytes of data.
64 bytes from 2.2.2.2: icmp_seq=1 ttl=61 time=0.581 ms
64 bytes from 2.2.2.2: icmp_seq=2 ttl=61 time=0.570 ms
64 bytes from 2.2.2.2: icmp_seq=3 ttl=61 time=0.536 ms
64 bytes from 2.2.2.2: icmp_seq=4 ttl=61 time=0.512 ms
^C
--- 2.2.2.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 101ms
rtt min/avg/max/mdev = 0.512/0.549/0.581/0.039 ms
[root@evpn1 ~]# ip netns exec host3 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0@if21: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:89:cb:f2:98:ea brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 192.168.3.3/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::89:cbff:fef2:98ea/64 scope link
valid_lft forever preferred_lft forever
[root@evpn1 ~]#
10.10.18.212节点上抓包
[root@evpn2 ~]# tcpdump -i vxlan1000 icmp -nnvv
tcpdump: listening on vxlan1000, link-type EN10MB (Ethernet), capture size 262144 bytes
14:54:20.497377 IP (tos 0x0, ttl 63, id 26398, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 1, length 64
14:54:20.497404 IP (tos 0x0, ttl 62, id 26398, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 1, length 64
14:54:21.515485 IP (tos 0x0, ttl 63, id 26468, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 2, length 64
14:54:21.515511 IP (tos 0x0, ttl 62, id 26468, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 2, length 64
14:54:22.555413 IP (tos 0x0, ttl 63, id 26535, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 3, length 64
14:54:22.555436 IP (tos 0x0, ttl 62, id 26535, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 3, length 64
14:54:23.595421 IP (tos 0x0, ttl 63, id 26569, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 4, length 64
14:54:23.595447 IP (tos 0x0, ttl 62, id 26569, offset 0, flags [none], proto ICMP (1), length 84)
2.2.2.2 > 192.168.3.3: ICMP echo reply, id 19340, seq 4, length 64
^C
8 packets captured
8 packets received by filter
0 packets dropped by kernel
[root@evpn2 ~]# tcpdump -i vxlan1000 icmp -nnvv
tcpdump: listening on vxlan1000, link-type EN10MB (Ethernet), capture size 262144 bytes
[root@evpn2 ~]# ip r sh vrf evpn-vrf2
default via 6.6.6.254 dev vrf2-in
2.2.2.0/24 via 10.10.18.209 dev br100 proto bgp metric 20 onlink
2.2.2.2 via 10.10.18.209 dev br100 proto bgp metric 20 onlink
3.3.3.2 via 10.10.18.209 dev br100 proto bgp metric 20 onlink
6.6.6.0/24 dev vrf2-in proto kernel scope link src 6.6.6.253
192.168.3.0/24 dev br40 proto kernel scope link src 192.168.3.254
192.168.3.3 via 10.10.18.209 dev br1000 proto bgp metric 20 onlink
192.168.4.0/24 dev br40 proto kernel scope link src 192.168.4.254
[root@evpn2 ~]#
evpn2.novalocal# show ip route vrf evpn-vrf2
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued route, r - rejected route
VRF evpn-vrf2:
K>* 0.0.0.0/0 [0/0] via 6.6.6.254, vrf2-in, 03w3d19h
B>* 2.2.2.0/24 [200/0] via 10.10.18.209, br100(vrf evpn-vrf) onlink, 00:57:10
B>* 3.3.3.2/32 [200/0] via 10.10.18.209, br100(vrf evpn-vrf) onlink, 00:01:48
C>* 6.6.6.0/24 is directly connected, vrf2-in, 03w3d19h
B 192.168.3.0/24 [20/0] via 10.10.18.209, br1000 onlink, 00:56:12
C>* 192.168.3.0/24 is directly connected, br40, 03:39:47
C>* 192.168.4.0/24 is directly connected, br40, 04:06:09
evpn2.novalocal# show ip bgp l2vpn evpn
BGP table version is 1, local router ID is 10.10.18.212
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 3.3.3.254:2
*> [5]:[0]:[24]:[2.2.2.0]
10.10.18.209 0 0 8888 i
RT:8888:100 ET:8 Rmac:00:00:01:02:03:07
Route Distinguisher: 9.9.9.254:2
*> [5]:[0]:[0]:[0.0.0.0]
10.10.18.212 0 32768 i
ET:8 RT:9999:100 Rmac:00:00:01:02:03:05
*> [5]:[0]:[24]:[9.9.9.0]
10.10.18.212 0 32768 i
ET:8 RT:9999:100 Rmac:00:00:01:02:03:05
*> [5]:[0]:[24]:[192.168.3.0]
10.10.18.212 0 0 8888 i
ET:8 RT:9999:100 Rmac:00:00:01:02:03:05
Route Distinguisher: 10.10.18.209:4
*> [3]:[0]:[32]:[10.10.18.209]
10.10.18.209 0 8888 i
RT:8888:10 ET:8
Route Distinguisher: 10.10.18.209:5
*> [2]:[0]:[48]:[b6:7a:bc:9e:4e:95]
10.10.18.209 0 8888 i
RT:8888:20 RT:8888:100 ET:8 Rmac:00:00:01:02:03:07
*> [2]:[0]:[48]:[b6:7a:bc:9e:4e:95]:[32]:[3.3.3.2]
10.10.18.209 0 8888 i
RT:8888:20 RT:8888:100 ET:8 Rmac:00:00:01:02:03:07
*> [2]:[0]:[48]:[b6:7a:bc:9e:4e:95]:[128]:[fe80::b47a:bcff:fe9e:4e95]
10.10.18.209 0 8888 i
RT:8888:20 ET:8
*> [3]:[0]:[32]:[10.10.18.209]
10.10.18.209 0 8888 i
RT:8888:20 ET:8
Route Distinguisher: 10.10.18.209:6
*> [3]:[0]:[32]:[10.10.18.209]
10.10.18.209 0 8888 i
RT:8888:88 ET:8
Route Distinguisher: 10.10.18.212:4
*> [2]:[0]:[48]:[00:00:01:02:03:10]:[32]:[2.2.2.254]
10.10.18.212 32768 i
ET:8 RT:9999:10 RT:9999:100 Rmac:00:00:01:02:03:05
*> [2]:[0]:[48]:[00:00:01:02:03:10]:[128]:[fe80::200:1ff:fe02:310]
10.10.18.212 32768 i
ET:8 RT:9999:10 RT:9999:100 Rmac:00:00:01:02:03:05
*> [3]:[0]:[32]:[10.10.18.212]
10.10.18.212 32768 i
ET:8 RT:9999:10
Route Distinguisher: 10.10.18.212:5
*> [3]:[0]:[32]:[10.10.18.212]
10.10.18.212 32768 i
ET:8 RT:9999:88
Route Distinguisher: 192.168.3.254:3
*> [5]:[0]:[24]:[192.168.3.0]
10.10.18.209 0 0 8888 i
RT:8888:1000 ET:8 Rmac:00:00:01:02:03:08
Route Distinguisher: 192.168.4.254:3
*> [5]:[0]:[0]:[0.0.0.0]
10.10.18.212 0 32768 i
ET:8 RT:9999:1000 Rmac:00:00:01:02:03:06
*> [5]:[0]:[24]:[2.2.2.0]
10.10.18.212 0 0 8888 i
ET:8 RT:9999:1000 Rmac:00:00:01:02:03:06
*> [5]:[0]:[32]:[3.3.3.2]
10.10.18.212 0 8888 i
ET:8 RT:9999:1000 Rmac:00:00:01:02:03:06
Displayed 18 out of 18 total prefixes
evpn2.novalocal# exit