VirtualBox

Opened 4 years ago

Closed 4 years ago

#19615 closed defect (invalid)

Linux - hostonlif ipconfig modifies system default route

Reported by: cssolomonides Owned by:
Component: network/hostif Version: VirtualBox 6.1.6
Keywords: linux default route system Cc:
Guest type: other Host type: Linux

Description (last modified by Valery Ushakov)

Hello,

creating a hostonlyif and assigning an IP to it via vboxmanage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1 results in mangling the host system routing, giving maximum priority to the hostonly interface for default route.

$ vboxmanage --version
6.1.6_Ubuntur137129

$ ip route ls
default via 192.168.10.1 dev wlan0 proto dhcp src 192.168.10.4 metric 303 mtu 1500

$ vboxmanage hostonlyif create
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'vboxnet0' was successfully created

$ ip route ls
default via 192.168.10.1 dev wlan0 proto dhcp src 192.168.10.4 metric 303 mtu 1500

$ vboxmanage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1

$ ip route ls
default via 192.168.56.1 dev vboxnet0 src 192.168.56.1 metric 212
default via 192.168.10.1 dev wlan0 proto dhcp src 192.168.10.4 metric 303 mtu 1500

As this behavior mangles system network connectivity, it would be expected that the default route created by the hostif network has lower priority compared to existing ones.

Change History (4)

comment:1 by Valery Ushakov, 4 years ago

Description: modified (diff)

comment:2 by Valery Ushakov, 4 years ago

This is strange. All it does, is, effectively:

# ip link set dev vboxnet0 up
# ip addr add 192.168.56.1/24 broadcast 192.168.56.255 dev vboxnet0

You can verify this by running

strace -f .../VBoxNetAdpCtl vboxnet0 192.168.56.1 netmask 255.255.255.0 2>&1 > /dev/null | grep 'exec.*/sbin/ip'

(where VBoxNetAdpCtl is in the vbox internal bin dir, whereever that is in the package).

comment:3 by cssolomonides, 4 years ago

You may close as invalid. This was due to leftover configuration to a dhcpcd server that set the route for vboxnet0

comment:4 by Valery Ushakov, 4 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use