Hello,
I am trying to configure vrf in a very simple topology: eth0
is the wan
interface in the default
vrf and eth2
is in the pippo
vrf. My goal is to leak the wan
default route to the pippo
vrf. Here is the configuration:
interfaces {
ethernet eth0 {
address dhcp
}
ethernet eth2 {
address 10.0.0.1/24
vrf pippo
}
}
nat {
source {
rule 10 {
outbound-interface {
name eth0
}
translation {
address masquerade
}
}
}
}
protocols {
static {
route 10.0.0.0/24 {
interface eth2 {
vrf pippo
}
}
}
}
vrf {
name pippo {
protocols {
static {
route 0.0.0.0/0 {
next-hop 192.168.154.2 {
interface eth0
vrf default
}
}
route 192.168.154.0/24 {
interface eth0 {
vrf default
}
}
}
}
table 1000
}
}
Here are the generated routing tables:
vyos@vyos:~$ show ip route vrf all
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 default:
S>* 0.0.0.0/0 [210/0] via 192.168.154.2, eth0, weight 1, 00:14:00
S>* 10.0.0.0/24 [1/0] is directly connected, eth2 (vrf pippo), weight 1, 01:31:56
C>* 192.168.154.0/24 is directly connected, eth0, 00:14:00
VRF pippo:
S>* 0.0.0.0/0 [1/0] via 192.168.154.2, eth0 (vrf default), weight 1, 00:14:00
C>* 10.0.0.0/24 is directly connected, eth2, 01:31:56
S>* 192.168.154.0/24 [1/0] is directly connected, eth0 (vrf default), weight 1, 00:14:01
And here is the information about the interfaces:
vyos@vyos:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address MAC VRF MTU S/L Description
----------- ------------------ ----------------- ------- ----- ----- -------------
eth0 192.168.154.128/24 xx:xx:xx:xx:xx:xx default 1500 u/u
eth2 10.0.0.1/24 xx:xx:xx:xx:xx:xx pippo 1500 u/u
lo 127.0.0.1/8 00:00:00:00:00:00 default 65536 u/u
::1/128
I can ping the internet from the default vrf, while I cannot from the pippo
vrf:
vyos@vyos:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=13.2 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=14.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=128 time=13.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=128 time=13.7 ms
vyos@vyos:~$ ping 8.8.8.8 vrf pippo
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
Do you see anything wrong or missing in my configuration?
How can I debug this problem?
Forgotten to report the VyOS version I am using: 1.5-rolling-202401030023
.