[Solved] Host only adapter - can't connect

Discussions related to using VirtualBox on Linux hosts.
Post Reply
bernid
Posts: 7
Joined: 27. Nov 2017, 15:18
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: other Linux

[Solved] Host only adapter - can't connect

Post by bernid »

Hi,
I've just set host-only adapter on my host ubuntu and trying to connect to my guest x86-64 linux based software router - IPFire.
I can not ping from ubuntu to IPfire and from IPFire to ubuntu.
How could I diagnose and fix this?

Code: Select all

root@ipfire:~$ ping 192.168.56.1
PING 192.168.56.1 (192.168.56.1) 56(84) bytes of data.
From 192.168.56.101 icmp_seq=9 Destination Host Unreachable

Code: Select all

ela@akacja:~$ ping 192.168.56.101
PING 192.168.56.101 (192.168.56.101) 56(84) bytes of data.
From 192.168.56.1 icmp_seq=9 Destination Host Unreachable
See VirtualBox log
VBox.log.zip
log file
(16 KiB) Downloaded 11 times
and
showvminfo below:

Code: Select all

ela@akacja:~$ vboxmanage showvminfo IPFire  --details
Name:            IPFire
Groups:          /
Guest OS:        Linux 2.6 / 3.x / 4.x (64-bit)
UUID:            25846548-deed-451a-b1a4-b1e188f8b03c
Config file:     /home/ela/VirtualBox VMs/IPFire/IPFire.vbox
Snapshot folder: /home/ela/VirtualBox VMs/IPFire/Snapshots
Log folder:      /home/ela/VirtualBox VMs/IPFire/Logs
Hardware UUID:   25846548-deed-451a-b1a4-b1e188f8b03c
Memory size:     4863MB
Page Fusion:     off
VRAM size:       16MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  4
PAE:             on
Long Mode:       on
Triple Fault Reset: off
APIC:            on
X2APIC:          on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): DVD
Boot Device (2): HardDisk
Boot Device (3): Network
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
BIOS APIC mode:  APIC
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
Effective Paravirt. Provider: KVM
State:           running (since 2017-11-27T07:18:07.605000000)
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
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
Storage Controller Name (1):            SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
IDE (1, 0): Empty
SATA (0, 0): /home/ela/VirtualBox VMs/IPFire/IPFire.vdi (UUID: 2aaa0883-d30c-4bdc-bad9-d43f611bca6c)
NIC 1:           MAC: 080027C252B3, Attachment: Bridged Interface 'enp2s0f1', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 2:           MAC: 0800270EE54C, Attachment: Bridged Interface 'enp2s0f0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           MAC: 080027461666, Attachment: Bridged Interface 'wlp3s0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 4:           MAC: 08002731950E, Attachment: Host-only 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 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
UART 3:          disabled
UART 4:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           disabled
Audio playback:  disabled
Audio capture: enabled
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    GUI/Qt
Video mode:      640x480x32 at 0,0 enabled
VRDE:            disabled
USB:             disabled
EHCI:            disabled
XHCI:            enabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Capturing:          not active
Capture screens:    0
Capture file:       /home/ela/VirtualBox VMs/IPFire/IPFire.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25
Capture options:    ac_enabled=false

Guest:

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

Guest Facilities:

No active facilities.
Network interfaces from ubuntu side:

Code: Select all

ela@akacja:~$ ifconfig -a
enp2s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::a236:9fff:fea2:b90e  prefixlen 64  scopeid 0x20<link>
        ether a0:36:9f:a2:b9:0e  txqueuelen 1000  (Ethernet)
        RX packets 100649  bytes 17877503 (17.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 95001  bytes 75827338 (75.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0x91600000-916fffff  

enp2s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.23  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::a236:9fff:fea2:b90f  prefixlen 64  scopeid 0x20<link>
        ether a0:36:9f:a2:b9:0f  txqueuelen 1000  (Ethernet)
        RX packets 89074  bytes 83825563 (83.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 93196  bytes 14812174 (14.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0x91700000-917fffff  

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 1925  bytes 165772 (165.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1925  bytes 165772 (165.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.1  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::800:27ff:fe00:0  prefixlen 64  scopeid 0x20<link>
        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 4909  bytes 367101 (367.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.17  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::eca7:a5c7:43dd:64ae  prefixlen 64  scopeid 0x20<link>
        ether 18:f4:6a:30:ae:50  txqueuelen 1000  (Ethernet)
        RX packets 1788  bytes 270482 (270.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2142  bytes 295589 (295.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
and from IPFire. (eth3 is connected to host only adapter):

Code: Select all

[root@ipfire ~]# ifconfig -a
blue0     Link encap:Ethernet  HWaddr 08:00:27:46:16:66
           inet addr:192.168.3.1  Bcast:192.168.3.255 Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:67 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:4212 (4.1 Kb)  TX bytes:0 (0.0 b)

eth3      Link encap:Ethernet  HWaddr 08:00:27:31:95:0E
           inet addr:192.168.56.101  Bcast:192.168.56.255 Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:190 errors:0 dropped:0 overruns:0 frame:0
           TX packets:4730 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:17511 (17.1 Kb)  TX bytes:350435 (342.2 Kb)

green0    Link encap:Ethernet  HWaddr 08:00:27:0E:E5:4C
           inet addr:192.168.2.1  Bcast:192.168.2.255 Mask:255.255.255.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:99876 errors:0 dropped:0 overruns:0 frame:0
           TX packets:86718 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:16296867 (15.5 Mb)  TX bytes:75082083 (71.6 Mb)

green1    Link encap:Ethernet  HWaddr 08:00:27:0E:E5:4C
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:99985 errors:0 dropped:0 overruns:0 frame:0
           TX packets:95223 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:17697782 (16.8 Mb)  TX bytes:87100654 (83.0 Mb)

lo        Link encap:Local Loopback
           inet addr:127.0.0.1  Mask:255.0.0.0
           UP LOOPBACK RUNNING  MTU:65536  Metric:1
           RX packets:375 errors:0 dropped:0 overruns:0 frame:0
           TX packets:375 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:100144 (97.7 Kb)  TX bytes:100144 (97.7 Kb)

red0      Link encap:Ethernet  HWaddr 08:00:27:C2:52:B3
           inet addr:192.168.0.29  Bcast:192.168.0.255 Mask:255.255.255.0
           UP BROADCAST RUNNING  MTU:1500  Metric:1
           RX packets:72934 errors:0 dropped:0 overruns:0 frame:0
           TX packets:79314 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:70482925 (67.2 Mb)  TX bytes:12520442 (11.9 Mb)
[root@ipfire ~]#
Last edited by bernid on 29. Nov 2017, 17:43, edited 2 times in total.
flichten
Posts: 4
Joined: 29. Jun 2017, 09:10

Re: Host only adapter

Post by flichten »

Hi

please issue "route" command in your terminal and post the output.
bernid
Posts: 7
Joined: 27. Nov 2017, 15:18
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: other Linux

Re: Host only adapter

Post by bernid »

Hi,
Thanks for replay.
'route' command from host (ubuntu server):

Code: Select all

ela@akacja:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         ipfire.localdom 0.0.0.0         UG    100    0        0 enp2s0f1
default         ipfire.localdom 0.0.0.0         UG    600    0        0 wlp3s0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 enp2s0f1
ipfire.localdom 0.0.0.0         255.255.255.255 UH    100    0        0 enp2s0f1
192.168.1.0     0.0.0.0         255.255.255.0   U     600    0        0 wlp3s0
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vboxnet0
and from guest (IPFire):

Code: Select all

[root@ipfire ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    202    0        0 red0
192.168.0.0     *               255.255.255.0   U     202    0        0 red0
192.168.2.0     *               255.255.255.0   U     0      0        0 green0
192.168.3.0     *               255.255.255.0   U     0      0        0 blue0
192.168.56.0    *               255.255.255.0   U     0      0        0 eth3
I also tried to define new firewall rules to open the traffic between vboxnet0 <->eth3 but without success...
I will be grateful for any tip. TIA
firewalls rules
firewalls rules
hoA.png (13.13 KiB) Viewed 2046 times
bernid
Posts: 7
Joined: 27. Nov 2017, 15:18
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: other Linux

Re: Host only adapter - can't connect

Post by bernid »

Ok.
Ping from host to guest and from guest to host is working now.
The cause of the issue was probably the bridge I've made on guest side. I've bridged green+ eth3 network interfaces.
Without the bridge ping works fine,
I have to modify settings on guest side to have eth3 and existing LAN (green0) as single network...
Regards,
Post Reply