0

I've got a CentOS host with a CentOS guest (both 6.5). On my guest I've installed and setup Samba, and given it a fixed ip of 192.168.1.2 (my host is 192.168.1.1 / my router is 192.168.1.254). From a separate Windows machine, I can ping 192.168.1.2 successfully, but when I try to ping 198.168.1.1 I get

Reply from 192.168.1.74: Destination host unreachable

what's confusing me is 192.168.1.74 is the ip of the Windows computer. When I try to access \\192.168.1.2 I get 'Windows cannot access \192.168.1.2'

From my host, I can't ping the router, the guest, or the Windows machine; the error is always:

From 192.168.1.253 icmp_seq=2 Destination host unreachable

192.168.1.253 is the ip I gave to the Host-only network (after following these instructions).

Useful(?) info

running ifconfig on host:

eth0     Link encap:Ethernet HWaddr <mac address>
         inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
         inet6 addr: fe80::219::dbff:fedd:85ff/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
         RX packets:1579724 errors:0 dropped:0 overruns:0 frame:0
         TX packets:799227 errors:2 dropped:0 overruns:0 carrier:2
         collisions:26201 txqueuelen:1000
         RX bytes:2280375441 (2.1 GiB) TX bytes:53645618 (51.1 MiB)

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:16436 Metric:1
         RX packets:157 errors:0 dropped:0 overruns:0 frame:0
         TX packets:157 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:25088 (14.7 KiB) TX bytes:15088 (14.7 KiB)

vboxnet0 Link encap:Ethernet <mac address>
         inet addr:192.168.1.253 Bcast:192.168.1.255 Mask:255.255.255.0
         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:158 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:0 (0.0 KiB) TX bytes:30600 (29.8 KiB)

Content of host's /etc/sysconfig/network-scripts/ifcdg-eth0

DEVICE=0
NM_CONTROLLED=yes
ONBOOT=yes
HWAddr <mac address>
TYPE=Ethernet
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0    

running ifconfig on the guest:

eth0  Link encap:Ethernet  HWaddr <mac address>
      inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe7e:c981/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)
      Interrupt:9 Base address:0xd240

eth1  Link encap:Ethernet  HWaddr <mac address>
      inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fed9:e691/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:5614 errors:4 dropped:0 overruns:0 frame:0
      TX packets:3055 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:5885081 (5.6 MiB)  TX bytes:498347 (486.6 KiB)
      Interrupt:10 Base address:0xd020

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:16436  Metric:1
      RX packets:8 errors:0 dropped:0 overruns:0 frame:0
      TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b)

Content of guest's /etc/sysconfig/network-scripts/ifcdg-eth0

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=<mac address>
NETMASK=255.255.255.0
IPADDR=192.168.1.2

Result of running testparm

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[Share]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
    workgroup = MyWG
    log file = /var/log/samba/log.%m
    max log size = 50
    idmap config * : backend = tdb
    cups options = raw

[homes]
    comment = Home Directories
    read only = No
    browseable = No

[printers]
    comment = All Printers
    path = /var/spool/samba
    printable = Yes
    print ok = Yes
    browseable = No

[Share]
    path = /SharedFiles
    valid users = Dev
    read only = No

Any hints where I might have gone wrong / or links to other / better tutorials welcomed!

3
  • If you can't ping your physical host from another machine, how is this a VirtualBox-related issue? Dec 15, 2013 at 21:14
  • Good comment well made, but I assume it's to do with the Host-only network I set up (which is VirtualBox related)
    – ChrisW
    Dec 15, 2013 at 21:17
  • So, does this issue only affect pings or are you also having other network issues? Also check your routes (route -n). Your guest has two network adapters, which one is the one of the host-only network? It wouldn't be surprising that your Windows client can't reach a share on the IP address of the host-only network (as that is only connected to the host). You might want to leave Samba out of your troubleshooting for now as that might have completely different issues. Also make sure ICMP PING responses are generally allowed on the machines in question. Dec 15, 2013 at 21:23

2 Answers 2

0

Your problem is that, in setting up the Host-only network, you have used exactly the same network as your LAN, i.e. 192.168.1.0/24.This is a source of confusion.

To correct this, all you have to do is to correct the subnet of the Host-only network: File -> Preferences -> Network -> Host-only Networks -> Screwdriver and change the IP addresses both in DHCP and in Adapter. Pick something unusual, like 192.168.133.0/24, and you will be Ok.

-1

As I understand, you are using a Host-only network. As the name implies, well, it only communicates with the host. If you need to access the virtual machine from other (real)machines, you should set-up a bridged network, and the guest will behave as if just was another machine on your network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .