Not able to ping newly created host-only Ethernet Adapter

Discussions related to using VirtualBox on Windows hosts.
Post Reply
virtualboxnewbie
Posts: 22
Joined: 25. Aug 2012, 08:23

Not able to ping newly created host-only Ethernet Adapter

Post by virtualboxnewbie »

Dear all,

this is how I created the virtualbox host-only Ethernet Adapter

Code: Select all

VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #3" --ip 192.168.3.1  --netmask 255.255.255.0
I 've created previously another one previously

Code: Select all

VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #2" --ip 192.168.1.1  --netmask 255.255.255.0

here's the partial result of ipconfig /all

Code: Select all

Ethernet adapter VirtualBox Host-Only Network #2:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter #2
   Physical Address. . . . . . . . . : 0A-00-27-00-00-03
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::949e:f8f8:7cb6:2a60%3(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 453640231
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-CC-26-31-54-E1-AD-C0-ED-62
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter VirtualBox Host-Only Network #3:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter #3
   Physical Address. . . . . . . . . : 0A-00-27-00-00-05
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::998a:3df1:12ea:7c3c%5(Preferred)
   IPv4 Address. . . . . . . . . . . : 198.168.3.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 118095911
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-CC-26-31-54-E1-AD-C0-ED-62
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

[code]
However there's a difference, I was able to ping -n 3 192.68.1.1 but not able to ping 192.168.3.1, why am I not able to ping 192.168.3.1? 've already disable my firewall already.

many thanks in advance!
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Not able to ping newly created host-only Ethernet Adapter

Post by BillG »

Basically because they are not in the same IP subnet. You could not ping between those two on any network. Nothing to do with VirtualBox.

You seem to have the wrong idea about what the host only network is about. A host only network allows network access between the host PC and the vm guests. You create a host only network on the host which creates a virtual network connected to the host's virtual adapter. If you want the guest to have access to the host, you set the network adapter in the guest to Host-only adapter and make sure that it has a IP in the same IP subnet as the host's adapter.

If you create another host only adapter it will create another virtual adapter on the host in a different IP subnet. If you wanted to access this new host adapter from a vm, you would need another NIC enabled in the vm set to host-only and with a IP address in the correct IP subnet for this network.

Normally you would need a router to route traffic from one IP subnet to another - even if they were on the same physical or virtual network.
Bill
virtualboxnewbie
Posts: 22
Joined: 25. Aug 2012, 08:23

Re: Not able to ping newly created host-only Ethernet Adapter

Post by virtualboxnewbie »

Dear BilG,

I understand what you mean. thanks

but I believe you have misunderstaood what I mean.

I've previously created a new VirtualBox Host-Only Ethernet Adapter #2

Code: Select all

VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #2" --ip 192.168.1.1  --netmask 255.255.255.0
partial ip config

Code: Select all


Ethernet adapter VirtualBox Host-Only Network #2:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter #2
Physical Address. . . . . . . . . : 0A-00-27-00-00-03
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::949e:f8f8:7cb6:2a60%3(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 453640231
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-CC-26-31-54-E1-AD-C0-ED-62
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
I was able to ping to 192.168.1.1 upon creation of the hostonly adapter.



but when i created VirtualBox Host-Only Ethernet Adapter #3

Code: Select all

VBoxManage hostonlyif ipconfig "VirtualBox Host-Only Ethernet Adapter #3" --ip 192.168.3.1  --netmask 255.255.255.0

partial ip config

Code: Select all

Ethernet adapter VirtualBox Host-Only Network #3:

Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter #3
Physical Address. . . . . . . . . : 0A-00-27-00-00-05
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::998a:3df1:12ea:7c3c%5(Preferred)
IPv4 Address. . . . . . . . . . . : 198.168.3.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 118095911
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-27-CC-26-31-54-E1-AD-C0-ED-62
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled


I'm not able to ping to 192.168.3.1, i.e the IP i assigned to the newly created hostonly adapter

If the logic is that I should not be able to ping, why is it that I was able to ping to adapter #2 upon creation?

many thanks

Best Regards, Chun Hung
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Not able to ping newly created host-only Ethernet Adapter

Post by fth0 »

Your description is missing one important detail: From where do you ping?

If no VMs are involved and you're pinging from the host itself, I'd expect it to work (at least after a host reboot).

If any VM is involved, try to better describe what you're doing.
Post Reply