help with bridged networking

Discussions related to using VirtualBox on Linux hosts.
Post Reply
virt_box_man
Posts: 4
Joined: 17. Dec 2015, 01:02

help with bridged networking

Post by virt_box_man »

Hi,

I am running VirtualBox 5.0 on a CentOS 6.7 server with a single physical network interface connected to the network. The guest is CentOS 7.1.

I'm unable to get bridged networking to work and suspect I'm missing something simple.

Below are outputs from the VirtualBox server, in this order:

vboxmanage showvminfo --details
vboxmanage list bridgedifs
vboxmanage list hostonlyifs
brctl show
ifconfig -a
route
sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.default.forwarding net.ipv4.conf.eth0.forwarding net.ipv4.conf.br0.forwarding net.ipv4.conf.vboxnet0.forwarding net.ipv4.ip_forward

Attached is a jpg screenshot of the guest's output of ifconfig -a and route.

My goal is to have the VirtualBox host on the network at 10.13.106.28 and the guest at 10.13.106.50, both on the same physical interface.

I have a feeling I'm missing something simple, any help would be appreciated. Thank you.

vboxmanage showvminfo --details

Code: Select all

# vboxmanage showvminfo "morpheus-appliance" --details
Name:            morpheus-appliance
Groups:          /
Guest OS:        Red Hat (64-bit)
UUID:            3fc9f1ac-03e3-4eba-bc6a-36f9744035b7
Config file:     /root/VirtualBox VMs/morpheus-appliance/morpheus-appliance.vbox
Snapshot folder: /root/VirtualBox VMs/morpheus-appliance/Snapshots
Log folder:      /root/VirtualBox VMs/morpheus-appliance/Logs
Hardware UUID:   3fc9f1ac-03e3-4eba-bc6a-36f9744035b7
Memory size:     4096MB
Page Fusion:     off
VRAM size:       8MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
PAE:             on
Long Mode:       on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             local time
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2015-12-16T22:42:25.305000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0):            IDE Controller
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
IDE Controller (0, 0): /mnt/data/vbox/disk/morpheus-appliance.vdi (UUID: eb75f754-41dd-4ea9-ac07-303e6514e414)
IDE Controller (0, 1): Empty
NIC 1:           MAC: 0800277CC630, Attachment: Bridged Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           disabled
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    headless
Video mode:      720x400x0 at 0,0 enabled
VRDE:            enabled (Address 0.0.0.0, Ports 3389, MultiConn: off, ReuseSingleConn: off, Authentication type: null)
VRDE port:       3389
Video redirection: disabled
VRDE property: TCP/Ports  = "3389"
VRDE property: TCP/Address = <not set>
VRDE property: VideoChannel/Enabled = <not set>
VRDE property: VideoChannel/Quality = <not set>
VRDE property: VideoChannel/DownscaleProtection = <not set>
VRDE property: Client/DisableDisplay = <not set>
VRDE property: Client/DisableInput = <not set>
VRDE property: Client/DisableAudio = <not set>
VRDE property: Client/DisableUSB = <not set>
VRDE property: Client/DisableClipboard = <not set>
VRDE property: Client/DisableUpstreamAudio = <not set>
VRDE property: Client/DisableRDPDR = <not set>
VRDE property: H3DRedirect/Enabled = <not set>
VRDE property: Security/Method = <not set>
VRDE property: Security/ServerCertificate = <not set>
VRDE property: Security/ServerPrivateKey = <not set>
VRDE property: Security/CACertificate = <not set>
VRDE property: Audio/RateCorrectionMode = <not set>
VRDE property: Audio/LogPath = <not set>
USB:             disabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    active
Clients so far:     2
Start time:         2015/12/16 22:47:46 UTC
Sent:               1498979 Bytes
Average speed:      1350 B/s
Sent total:         1498979 Bytes
Received:           41053 Bytes
Speed:              36 B/s
Received total:     41053 Bytes
User name:
Domain:
Client name:        SINGLECASK
Client IP:          10.13.102.74
Client version:     7601
Encryption:         RDP4

Video capturing:    not active
Capture screens:    0
Capture file:       /root/VirtualBox VMs/morpheus-appliance/morpheus-appliance.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             RedHat_64
Additions run level:                 0

Guest Facilities:

No active facilities.
vboxmanage list bridgedifs

Code: Select all

# vboxmanage list bridgedifs
Name:            br0
GUID:            00307262-0000-4000-8000-0015175af3d4
DHCP:            Disabled
IPAddress:       10.13.106.28
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:0215:17ff:fe5a:f3d4
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:15:17:5a:f3:d4
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-br0

Name:            eth0
GUID:            30687465-0000-4000-8000-0015175af3d4
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:     fe80:0000:0000:0000:0215:17ff:fe5a:f3d4
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 00:15:17:5a:f3:d4
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-eth0

Name:            eth1
GUID:            31687465-0000-4000-8000-0015175af3d5
DHCP:            Disabled
IPAddress:       0.0.0.0
NetworkMask:     0.0.0.0
IPV6Address:
IPV6NetworkMaskPrefixLength: 0
HardwareAddress: 00:15:17:5a:f3:d5
MediumType:      Ethernet
Status:          Down
VBoxNetworkName: HostInterfaceNetworking-eth1
vboxmanage list hostonlyifs

Code: Select all

# vboxmanage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       10.13.106.50
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:0800:27ff:fe00:0000
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0
brctl show

Code: Select all

# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.0015175af3d4       no              eth0
                                                        vboxnet0
ifconfig -a

Code: Select all

# ifconfig -a
br0       Link encap:Ethernet  HWaddr 00:15:17:5A:F3:D4
          inet addr:10.13.106.28  Bcast:10.13.106.255  Mask:255.255.255.0
          inet6 addr: fe80::215:17ff:fe5a:f3d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19847 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17683 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2637937 (2.5 MiB)  TX bytes:3296496 (3.1 MiB)

eth0      Link encap:Ethernet  HWaddr 00:15:17:5A:F3:D4
          inet6 addr: fe80::215:17ff:fe5a:f3d4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:79353 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74192 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12567497 (11.9 MiB)  TX bytes:9189910 (8.7 MiB)
          Interrupt:18 Memory:b8820000-b8840000

eth1      Link encap:Ethernet  HWaddr 00:15:17:5A:F3:D5
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:19 Memory:b8800000-b8820000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:398 errors:0 dropped:0 overruns:0 frame:0
          TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:42025 (41.0 KiB)  TX bytes:42025 (41.0 KiB)

vboxnet0  Link encap:Ethernet  HWaddr 0A:00:27:00:00:00
          inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1993 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:166180 (162.2 KiB)
route

Code: Select all

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.13.106.0     *               255.255.255.0   U     0      0        0 br0
link-local      *               255.255.0.0     U     1009   0        0 br0
default         10.13.106.1     0.0.0.0         UG    0      0        0 br0
sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.default.forwarding net.ipv4.conf.eth0.forwarding net.ipv4.conf.br0.forwarding net.ipv4.conf.vboxnet0.forwarding net.ipv4.ip_forward

Code: Select all

# sysctl net.ipv4.conf.all.forwarding net.ipv4.conf.default.forwarding net.ipv4.conf.eth0.forwarding net.ipv4.conf.br0.forwarding net.ipv4.conf.vboxnet0.forwarding net.ipv4.ip_forward
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.eth0.forwarding = 1
net.ipv4.conf.br0.forwarding = 1
net.ipv4.conf.vboxnet0.forwarding = 1
net.ipv4.ip_forward = 1
screenshot of guest's output of ifconfig -a and route
Attachments
guest.jpg
guest.jpg (120.26 KiB) Viewed 3086 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: help with bridged networking

Post by socratis »

virt_box_man wrote:NIC 1: MAC: 0800277CC630, Attachment: Bridged Interface 'vboxnet0'
Did you actually attach/bridge the network card to your host-only adapter? I'm not too much of a Linux person (guest or host), so I could be way off, but it seems like it...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
virt_box_man
Posts: 4
Joined: 17. Dec 2015, 01:02

Re: help with bridged networking

Post by virt_box_man »

Thanks for the reply! Isn't this is shown in the brctl show output above?
SpahZ
Posts: 31
Joined: 26. Nov 2015, 21:21

Re: help with bridged networking

Post by SpahZ »

. .
. . why would you be using a host-only setup and a bridged setup on the host ? . .
. . host only is for internal (to the host) networking and does not talk to the outside
. . you don't need to do any bridging setup on the host or the guest . . .
. . the net filter driver for transparent bridging selected for the guest is the only setup required.
. . i suppose a test to see if a host-only interface could be broken out of jail with bridging would be an interesting experiment
. . i have 3 dozen + guests setup each with their own static IP recorded in my own local DNS . .
. . course,, only a few can be running at any one time , , ,

. . to get one click access to a root shell on em , , ,

("root at",
("aterm a64", EXEC, "sudo -H /root/aterm-root"),
("raterm a64", EXEC, "ssh -1 -a -n -q -l root a64 '(DISPLAY=a64:0 && export DISPLAY && /root/aterm-root)'"),
("aterm X4", EXEC, "ssh -a -n -q -l root X4 '(DISPLAY=a64:0 && export DISPLAY && /root/raterm-root)'"),
("aterm d1k", EXEC, "ssh -1 -a -n -q -l root d1k '(DISPLAY=a64:0 && export DISPLAY && /root/aterm-root)'"),
("aterm cpq", EXEC, "ssh -1 -a -n -q -l root cpq '(DISPLAY=a64:0 && export DISPLAY && /root/aterm-root)'"),
("aterm c5r", EXEC, "ssh -1 -a -n -q -l root c5r '(DISPLAY=a64:0 && export DISPLAY && /root/aterm-root)'"),
("aterm c7k", EXEC, "ssh -1 -a -n -q -l root c7k '(DISPLAY=a64:0 && export DISPLAY && /root/aterm-root)'"),

. . i think that's the kinda thing you have in mind,
. . they don't require any bridging setup,, just bridged network type selection in the guest VM config . . .
. .
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: help with bridged networking

Post by socratis »

virt_box_man wrote:Isn't this is shown in the brctl show output above?
From a net search, I realized that "brctl" has to do with bridged configuration on the client. This is not exactly how it works in VirtualBox. Just as SpahZ said (I think), you configure Bridged mode in the VirtualBox configuration. Your guest doesn't have to do anything. For more information, see Chapter 6. Virtual networking. As I said, I'm not a Linux person, but I really didn't have to be to get it working.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
virt_box_man
Posts: 4
Joined: 17. Dec 2015, 01:02

Re: help with bridged networking

Post by virt_box_man »

why would you be using a host-only setup and a bridged setup on the host ?
because i am a total noob with both virtualbox and bridged networking. i am clueless.

all i'm trying to do is have a vbox guest's services (httpd, tomcat) available on the LAN like a regular server with a static IP.

i'm limited to CLI (no X or GUI) so i may not be able to test your examples with the export DISPLAY commands above.

thank you for your detailed reply, i will get started when i'm back on-site in a few days.

your help is very much appreciated.
SpahZ
Posts: 31
Joined: 26. Nov 2015, 21:21

Re: help with bridged networking

Post by SpahZ »

We all had to start somewhere

Ok,, short answer, you need no formal bridging setup at either end, guest or host. simply choose "bridged adapter"
in the guest network config, and the guest can be configured as if it was a physical adapter sharing
a hub with your host machine . .

Since your working from a text console, the change to the guest config takes the form

. . . VBoxManage modifyvm 'name of vm' --nic1 bridged

and you can simplify the nic config on your host / guest et al . .

The file with the export stuff et al.. launch buttons shown in a portion of my windowmaker desktop file,
And i assumed you would recognize at least in form what it was.
i use ssh as rexec,
xwindows is network transparent, so you do not need to run a gui on linux/bsd guests if you already have
an xserver display running on the host,, and this allows you to run guests with smaller memory allocation.

Sorry i added to the confusion by including unnecessary stuff in my earlier reply
Cheers!
virt_box_man
Posts: 4
Joined: 17. Dec 2015, 01:02

Re: help with bridged networking [solved]

Post by virt_box_man »

It works!

Thank you SpahZ!!
Post Reply