mpls on openbsd
$ cat /etc/ldpd.conf
fast=”2”
# global configuration
router-id 10.0.242.2
# lfib-update no
distribution independent
retention liberal
advertisement unsolicited
interface vlan902 {
hello-interval $fast
}
$ cat /etc/hostname.vlan902
inet 10.0.242.2 255.255.255.252 NONE vlan 902 vlandev em0 mpls description “MPLS Vlan”
up -inet6
# cat /etc/bgpd.conf
# BGP config
AS 4
router-id 10.0.242.2
listen on 10.0.242.2
connect-retry 10
holdtime 15
holdtime min 15
nexthop qualify via default
route-collector no
fib-update yes
allow from any inet prefixlen 0 - 32
allow from any prefix 0.0.0.0/0
#neighbors config
neighbor 10.0.242.1 {
remote-as 1
descr R30
local-address 10.0.242.2
announce IPv4 vpn
announce refresh yes
announce capabilities yes
}
#VRF config
rdomain 1 {
descr “rdomain 1”
rd 1:103
import-target rt 1:103
export-target rt 1:103
depend on mpe1
network 10.0.248.5/32
}
$ cat /etc/hostname.mpe1
rdomain 1
mplslabel 17
inet 10.0.248.1 255.255.255.255 NONE
up
$ cat /etc/hostname.lo1
rdomain 1
inet 10.0.248.5 255.255.255.255 NONE
up
$ route -n -T1 show
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Prio Iface
8.8.8.1/32 10.0.242.1 UGT 0 5 - 48 mpe1
8.8.8.2/32 10.0.242.1 UGT 0 0 - 48 mpe1
10.0.248.5 10.0.248.5 UH 0 0 33200 4 lo1
$ ping -V1 -I 10.0.248.5 8.8.8.1
PING 8.8.8.1 (8.8.8.1): 56 data bytes
64 bytes from 8.8.8.1: icmp_seq=0 ttl=254 time=0.893 ms
64 bytes from 8.8.8.1: icmp_seq=1 ttl=254 time=0.815 ms