Page 1 of 1

Guest loses network when switched to Bridged (both linux)

Posted: 18. Aug 2021, 15:05
by mn
(Mod edit: split from viewtopic.php?f=7&t=103413, topic title changed to new situation)

Hi
As you can see in the picture, when I set the network type to "bridge", the VM has no IP and no internet access.

Re: Unable to ssh from host to guest (both linux)

Posted: 18. Aug 2021, 16:56
by scottgus1
The problem of not getting access when switched to Bridged is a subject for a new topic, so I will split it off the old topic. "One issue per thread"

I have seen Linux hold onto old network info and not update to new IP addresses etc, without at least a virtual cable disconnect/reconnect, or without some kind of reset of the network adapter per the Linux OS methods.

Try researching how to completely reset the VM's network adapter system inside the VM's OS. See what you get.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 18. Aug 2021, 17:16
by mn
Problem is that I don't know what is expected in the bridged network. When I set the VM network type to NAT, it has 10.0.2.15 and I can access internet.

I started a brand new installation of the VM. So, before launching the Ubuntu installer, I set the network type to Bridged. I also created a DHCP server in the virtualbox. But the installer complains about network problem.

Any guess?

Re: Guest loses network when switched to Bridged (both linux)

Posted: 18. Aug 2021, 17:20
by scottgus1
mn wrote:I don't know what is expected in the bridged network.
See the other posts in the "Pictures" tutorial. There's one for Bridged too.

The bottom picture is for the Host Network Manager, which handles Host-Only networks, which are not used in Bridged.

Please right-click the VM in the main Virtualbox window's VM list, choose "Show in File Manager". In the window that opens, zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Please make sure all file extensions are shown, so you will be able to see the .vbox extension easier.)

Also, inside the host OS's terminal window, run 'ip address' or 'ifconfig', and post the text output here on the forum.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 18. Aug 2021, 17:35
by mn
Please see the attached files.
I didn't find "picture tutorials" in the tutorial section viewforum.php?f=23
May I know where it is?

Code: Select all

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp39s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 2c:f0:5d:a3:8b:57 brd ff:ff:ff:ff:ff:ff
    inet 172.18.20.175/22 brd 172.18.23.255 scope global dynamic noprefixroute enp39s0
       valid_lft 77638sec preferred_lft 77638sec
    inet6 fe80::9a4c:a21f:3a00:d98a/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
4: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
$ ifconfig -a
enp39s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.18.20.175  netmask 255.255.252.0  broadcast 172.18.23.255
        inet6 fe80::9a4c:a21f:3a00:d98a  prefixlen 64  scopeid 0x20<link>
        ether 2c:f0:5d:a3:8b:57  txqueuelen 1000  (Ethernet)
        RX packets 115986592  bytes 95339848862 (95.3 GB)
        RX errors 0  dropped 31585  overruns 0  frame 0
        TX packets 148564377  bytes 174772545548 (174.7 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 7786546  bytes 73693048782 (73.6 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7786546  bytes 73693048782 (73.6 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 0a:00:27:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Re: Guest loses network when switched to Bridged (both linux)

Posted: 18. Aug 2021, 19:05
by scottgus1
Sorry, I had posted the link to the tutorial in your other post. Oops! Virtualbox Networks: In Pictures

You have correctly set the VM to Bridged, it appears.

Your host IP address shows a valid but very unusual setup:
enp39s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.18.20.175 netmask 255.255.252.0
It is not common to use a 172.x.x.x range, or other than a 255.255.255.0 mask, in a home network, though it can be used.

Is your host PC in a corporate environment with strong IT overlords? If so they may have blocked your network connection from having more than one PC attached to the Ethernet jack, which will block Bridged.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 09:19
by mn
Yes the PC is on a local network and I am not aware of the configuration.
The host PC has one NIC which use connected to the office's socket by cable.

That is strange. I may follow the NAT+port forwarding for SSH access then.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 09:49
by mn
Should I ask anything about the network configuration from the IT office? Please let me know.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 10:36
by mpack
If this is an office, with a network managed by IT, then a bridged adapter will most likely not work. This is because a bridged VM is a full network participant, hence will appear as an unknown PC and be blocked from accessing the network.

You could ask IT to add that VM to the allowed list, but that would only fix one VM, you'd need management permission, and you'd be handing responsibility for the VM to IT. I'd think that people normally want to avoid this, as a common reason for creating VMs is to be flexible.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 14:20
by mn
Yes but I read from another tutorial and followed that.
Thanks.

EDIT: THAT STATEMENT WAS MIXED WITH ANOTHER TOPIC. SORRY ABOUT THAT.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 14:29
by scottgus1
mn wrote: I read from another tutorial and followed that.
Does this mean you got it to work? If so, please tell us what you did.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 14:46
by mn
I am sorry. I mixed up two topics. That was for the other topic for port forwarding.

Regarding this one, I found out that we have to register the MAC address of the PC in the office interanet. So, since with bridge networking, the VM is directly connected to the office's network, I asked about registering the MAC address of the virtual NIC. Hope that helps. I will come back later.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 19. Aug 2021, 16:50
by scottgus1
OK< that makes sense. Glad you're up and running!

Re: Guest loses network when switched to Bridged (both linux)

Posted: 24. Aug 2021, 11:52
by mn
The problem has been resolved. As I receive a static MAC address from the department, it is now working and the VM has an IP address with bridge networking.

Thanks.

Re: Guest loses network when switched to Bridged (both linux)

Posted: 24. Aug 2021, 16:56
by scottgus1
Thanks for the update! I added the idea of having to request connection info from IT to the Bridged "Pictures" tutorial.