Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM contains several default routes #2280

Open
vasileknik76 opened this issue Apr 9, 2024 · 5 comments
Open

VM contains several default routes #2280

vasileknik76 opened this issue Apr 9, 2024 · 5 comments
Labels
bug Something isn't working component/vz

Comments

@vasileknik76
Copy link
Contributor

vasileknik76 commented Apr 9, 2024

Description

I'm testing vzNat and noticed strange behavior. After startup, the VM contains several default routes. So network connections are balancing between slirp and vnNat.

Lima Version: v0.21.0
Template: experimental/vz.

Steps:

  • Run limactl start --name test --debug template://experimental/vz
  • Run limactl shell test ip r. Output:

Actual output:

default via 192.168.5.2 dev eth0 proto dhcp src 192.168.5.15 metric 100
default via 192.168.105.1 dev lima0 proto dhcp src 192.168.105.2 metric 100
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.15 metric 100
192.168.5.2 dev eth0 proto dhcp scope link src 192.168.5.15 metric 100
192.168.105.0/24 dev lima0 proto kernel scope link src 192.168.105.2 metric 100
192.168.105.1 dev lima0 proto dhcp scope link src 192.168.105.2 metric 100

Expected output (without first route):

default via 192.168.105.1 dev lima0 proto dhcp src 192.168.105.2 metric 100
192.168.5.0/24 dev eth0 proto kernel scope link src 192.168.5.15 metric 100
192.168.5.2 dev eth0 proto dhcp scope link src 192.168.5.15 metric 100
192.168.105.0/24 dev lima0 proto kernel scope link src 192.168.105.2 metric 100
192.168.105.1 dev lima0 proto dhcp scope link src 192.168.105.2 metric 100

This comes from cloud-init, but I haven't found an option to disable this in network-config

@vasileknik76 vasileknik76 changed the title [vzNat] VM contains several default routes VM contains several default routes Apr 9, 2024
@vasileknik76
Copy link
Contributor Author

vasileknik76 commented Apr 9, 2024

Off topic
Difference between user-v2 and vzNat is huge.
vzNat:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  64.9 GBytes  55.8 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  64.9 GBytes  55.8 Gbits/sec                  receiver

user-v2:

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  3.75 GBytes  3.22 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  3.75 GBytes  3.22 Gbits/sec                  receiver

This is a test between the virtual machine and the host using iperf3

@AkihiroSuda AkihiroSuda added bug Something isn't working component/vz labels Apr 10, 2024
@balajiv113
Copy link
Member

@AkihiroSuda
I believe we will always have our internal network (user-v2 or slirp) as default route right ??

@AkihiroSuda
Copy link
Member

AkihiroSuda commented Apr 11, 2024

@AkihiroSuda I believe we will always have our internal network (user-v2 or slirp) as default route right ??

SGTM, but the plan may change depending on the performance and stability

@balajiv113
Copy link
Member

Atleast with vzNAT i noticed that few cases of guest -> host network calls failing. This i noticed during very initial development of vz driver.

Maybe we can test and provide a option to override as per need basis

@vasileknik76
Copy link
Contributor Author

Atleast with vzNAT i noticed that few cases of guest -> host network calls failing

Same thing for me. In my case problem related to VPN. By default nat is disabled between the vpn and bridge interface. I applied nat rules using pfctl and the network started to work stably.

I believe we will always have our internal network (user-v2 or slirp) as default route right

This is unexpected behavior for me. VzNat in this case seems unnecessary. Only for connect the VM at a own address?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component/vz
Projects
None yet
Development

No branches or pull requests

3 participants