Skip to content

Instantly share code, notes, and snippets.

@hkwi
Last active November 30, 2018 10:08
Show Gist options
  • Save hkwi/967251dc5c83fffad00921f1587ce88a to your computer and use it in GitHub Desktop.
Save hkwi/967251dc5c83fffad00921f1587ce88a to your computer and use it in GitHub Desktop.
frrouting vpn/bgp+mpls inter-as option b

frrouting vpn/bgp+mpls inter-as option b

  • with next-hop-self
  • with loopback
  • without bgp labeled-unicast
  • without route-reflector
  • without multi-hop ebgp

r1, r2

exit
ip link add A type vrf table 10
ip link set A up
vtysh
conf t

r3, r4

exit
ip link add A type vrf table 10
ip link set A up
ip link set eth1 master A
vtysh
conf t
int lo
ip addr 100.0.0.1/32
int eth0
ip addr 192.168.0.1/24
int eth1
ip addr 192.168.1.1/24
ip route 100.0.0.2/32 192.168.0.2
ip route 100.0.0.3/32 192.168.1.2
router bgp 65000
no bgp default ipv4-unicast
neighbor 192.168.0.2 remote-as 65001
neighbor 100.0.0.3 remote-as 65000
neighbor 100.0.0.3 update-source lo
address-family ipv4
redistribute connected
neighbor 192.168.0.2 activate
neighbor 100.0.0.3 activate
address-family ipv4 vpn
neighbor 192.168.0.2 activate
neighbor 192.168.0.2 next-hop-self
neighbor 100.0.0.3 activate
neighbor 100.0.0.3 next-hop-self
router bgp 65000 vrf A
address-family ipv4
import vpn
export vpn
rd vpn export 100.0.0.1:1
rt vpn both 65000:1
label vpn export auto
redistribute connected
end
int lo
ip addr 100.0.0.2/32
int eth0
ip addr 192.168.0.2/24
int eth1
ip addr 192.168.2.1/24
ip route 100.0.0.1/32 192.168.0.1
ip route 100.0.0.4/32 192.168.2.2
router bgp 65001
no bgp default ipv4-unicast
neighbor 192.168.0.1 remote-as 65000
neighbor 100.0.0.4 remote-as 65001
neighbor 100.0.0.4 update-source lo
address-family ipv4
redistribute connected
neighbor 192.168.0.1 activate
neighbor 100.0.0.4 activate
address-family ipv4 vpn
neighbor 192.168.0.1 activate
neighbor 192.168.0.1 next-hop-self
neighbor 100.0.0.4 activate
neighbor 100.0.0.4 next-hop-self
router bgp 65001 vrf A
address-family ipv4
import vpn
export vpn
rd vpn export 100.0.0.2:1
rt vpn both 65000:1
label vpn export auto
redistribute connected
end
int lo
ip addr 100.0.0.3/32
int eth0
ip addr 192.168.1.2/24
int eth1 vrf A
ip addr 192.168.3.1/24
ip route 100.0.0.1/32 192.168.1.1
router bgp 65000
no bgp default ipv4-unicast
neighbor 100.0.0.1 remote-as 65000
neighbor 100.0.0.1 update-source lo
address-family ipv4
redistribute connected
neighbor 100.0.0.1 activate
address-family ipv4 vpn
neighbor 100.0.0.1 activate
neighbor 100.0.0.1 next-hop-self
router bgp 65000 vrf A
address-family ipv4
import vpn
export vpn
rd vpn export 100.0.0.3:1
rt vpn both 65000:1
label vpn export auto
redistribute connected
end
int lo
ip addr 100.0.0.4/32
int eth0
ip addr 192.168.2.2/24
int eth1 vrf A
ip addr 192.168.4.1/24
ip route 100.0.0.2/32 192.168.2.1
router bgp 65001
no bgp default ipv4-unicast
neighbor 100.0.0.2 remote-as 65001
neighbor 100.0.0.2 update-source lo
address-family ipv4
redistribute connected
neighbor 100.0.0.2 activate
address-family ipv4 vpn
neighbor 100.0.0.2 activate
neighbor 100.0.0.2 next-hop-self
router bgp 65001 vrf A
address-family ipv4
import vpn
export vpn
rd vpn export 100.0.0.4:1
rt vpn both 65000:1
label vpn export auto
redistribute connected
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment