Hi team
On Linux has the ability to connect interfaces veth, not just a namespace or container, if not different types of virtual networks. also enable communication with and between virtualized guest systems. A veth device has two associated Ethernet interfaces – so called “peer” interfaces.
“veth” devices are instead created as pairs of connected virtual Ethernet interfaces. These 2 devices can be imagined as being connected by a network cable; each veth-device of a pair can be attached to different virtual entities as OpenVswitch bridges, LXC containers or Linux standard bridges. veth pairs are ideal to connect virtual devices to each other.
example: veth interfaces to interconnect different vrf:
Step1: create and configure veth interface sudo ip link add DSR201-VE1 type veth peer name BR10-DSR201-VE1 sudo ip link add DSR202-VE1 type veth peer name BR10-DSR202-VE1 sudo ip link add DSR203-VE1 type veth peer name BR10-DSR203-VE1 sudo ip addr add 10.85.228.5/25 dev DSR201-VE1 sudo ip addr add 10.85.228.6/25 dev DSR202-VE1 sudo ip addr add 10.85.228.7/25 dev DSR203-VE1 sudo ip link set dev DSR201-VE1 up sudo ip link set dev DSR202-VE1 up sudo ip link set dev DSR203-VE1 up sudo ip link set dev BR10-DSR201-VE1 up sudo ip link set dev BR10-DSR202-VE1 up sudo ip link set dev BR10-DSR203-VE1 up Step2: associate veth with VRF(already created vrf ) sudo ip link set DSR201-VE1 vrf VRF-DSR201 sudo ip link set DSR202-VE1 vrf VRF-DSR202 sudo ip link set DSR203-VE1 vrf VRF-DSR203 Step3: create a bridge then bridge those veths sudo ip link add BR10-XSR type bridge sudo ip link set dev BR10-XSR up sudo ip link set BR10-DSR201-VE1 master BR10-XSR sudo ip link set BR10-DSR202-VE1 master BR10-XSR sudo ip link set BR10-DSR203-VE1 master BR10-XSR `
this configuration we can see something like this:
vyos@vyos-main-rt:~$ bridge link 36: BR10-DSR201-VE1@DSR201-VE1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master BR10-XSR state forwarding priority 32 cost 2 38: BR10-DSR202-VE1@DSR202-VE1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master BR10-XSR state forwarding priority 32 cost 2 40: BR10-DSR203-VE1@DSR203-VE1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master BR10-XSR state forwarding priority 32 cost 2 vyos@vyos-main-rt:~$ show bridge Bridge interface BR10-XSR: Member State MTU Flags Prio --------------- ---------- ----- ------------------------------- ------ BR10-DSR201-VE1 forwarding 1500 broadcast,multicast,up,lower_up 32 BR10-DSR202-VE1 forwarding 1500 broadcast,multicast,up,lower_up 32 BR10-DSR203-VE1 forwarding 1500 broadcast,multicast,up,lower_up 32 vyos@vyos-main-rt:~$ show ip route vrf VRF-DSR201 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, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF VRF-DSR201: C>* 10.85.228.0/25 is directly connected, DSR201-VE1, 02:06:01 vyos@vyos-main-rt:~$ show ip route vrf VRF-DSR202 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, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued, r - rejected, b - backup t - trapped, o - offload failure VRF VRF-DSR202: C>* 10.85.228.0/25 is directly connected, DSR202-VE1, 02:06:57 vyos@vyos-main-rt:~$ show ip route vrf VRF-DSR203 VRF VRF-DSR203: C>* 10.85.228.0/25 is directly connected, DSR203-VE1, 02:06:59 vyos@vyos-main-rt:~$ ping 10.85.228.5 vrf VRF-DSR201 PING 10.85.228.5 (10.85.228.5) 56(84) bytes of data. 64 bytes from 10.85.228.5: icmp_seq=1 ttl=64 time=0.054 ms 64 bytes from 10.85.228.5: icmp_seq=2 ttl=64 time=0.045 ms ^C --- 10.85.228.5 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1010ms rtt min/avg/max/mdev = 0.045/0.049/0.054/0.004 ms vyos@vyos-main-rt:~$ ping 10.85.228.6 vrf VRF-DSR201 PING 10.85.228.6 (10.85.228.6) 56(84) bytes of data. 64 bytes from 10.85.228.6: icmp_seq=1 ttl=64 time=0.099 ms 64 bytes from 10.85.228.6: icmp_seq=2 ttl=64 time=0.117 ms ^C --- 10.85.228.6 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1061ms rtt min/avg/max/mdev = 0.099/0.108/0.117/0.009 ms vyos@vyos-main-rt:~$ ping 10.85.228.7 vrf VRF-DSR201 PING 10.85.228.7 (10.85.228.7) 56(84) bytes of data. 64 bytes from 10.85.228.7: icmp_seq=1 ttl=64 time=0.086 ms 64 bytes from 10.85.228.7: icmp_seq=2 ttl=64 time=0.140 ms 64 bytes from 10.85.228.7: icmp_seq=3 ttl=64 time=0.086 m