Hello,
I am setting a lab on the virtualbox on my laptop and I’ve came across strange problem.
One virtual machine has two network interfaces:
- bridged to host wlan0 interface to have internet
- connected to internal network to provide internet access to another vm
Of course on this vm (running vyos 1.1.3) is configured nat to internal network
The other vm (runnin vyos 1.1.3) has two network interfaces:
- connected to internal network (the same as machine above)
- another internal network
The problem is with routing, I cannot configure second vm to have internet provided by first vm. Below are the configs. I cannot change addresses.
gateway config:
interfaces {
ethernet eth0 {
address dhcp
duplex auto
hw-id 08:00:27:0c:9e:2f
smp_affinity auto
speed auto
}
ethernet eth1 {
address 10.24.161.254/24
duplex auto
hw-id 08:00:27:6c:3f:e3
smp_affinity auto
speed auto
}
loopback lo {
}
}
nat {
source {
rule 10 {
outbound-interface eth0
source {
address 10.24.161.0/24
}
translation {
address masquerade
}
}
}
}
protocols {
static {
interface-route 10.24.162.0/26 {
next-hop-interface eth1 {
distance 1
}
}
}
}
The second VM:
interfaces {
ethernet eth0 {
address 10.24.162.1/26
duplex auto
hw-id 08:00:27:15:ab:d6
smp_affinity auto
speed auto
}
ethernet eth1 {
duplex auto
hw-id 08:00:27:38:4d:1a
smp_affinity auto
speed auto
}
ethernet eth2 {
duplex auto
hw-id 08:00:27:dc:14:3a
smp_affinity auto
speed auto
}
ethernet eth3 {
duplex auto
hw-id 08:00:27:5d:48:a7
smp_affinity auto
speed auto
}
loopback lo {
}
}
protocols {
static {
interface-route 10.24.161.0/24 {
next-hop-interface eth0 {
distance 1
}
}
route 0.0.0.0/0 {
next-hop 10.24.161.254 {
distance 1
}
}
}
}
There is another strange thing:
with the configuration above I have following route in the OS:
0.0.0.0 0.0.0.0 0.0.0.0 eth0
I think there should be something like:
0.0.0.0 10.24.161.254 0.0.0.0 eth0
Deleting this route and adding (not vyos way) in system default route like this:
route add default gw 10.24.161.254
works and the second vm has internet access through the gateway.
So what I am doing wrong? Or maybe there is some kind of bug in the software?
Thank You for every help and every tip.