Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Debian based virtual machine running on VMWare Fusion with a OS X 10.9 host OS.

In VMWare Fusion I have a private network setup that allows the Mac and the VM to communicate without access to the outside world, this is for me so that I can SSH/SHCP into the server without packets going out to a router. This is necessary for me so I can work with the VM when I'm not on an external network, such as when I'm on a plane or out and about.

The private network configuration in VMWare

In addition to the private network I would like to have the VM attached to a public network which I may enable or disable from time to time. Obviously having the VM able to reach the Internet may be necessary at time, so I configured the VM to have two network connections.

enter image description here

The first in the public network, which in VMWare is configured to be essentially whatever the Mac is connected to.

enter image description here

The second network is the private network.

enter image description here

This is the /etc/network/interfaces file I've written.

# The loopback network interface
auto lo
iface lo inet loopback

# The public network interface
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

# The private network interface
auto eth1
allow-hotplug eth1
iface eth1 inet static
        address 192.168.1.250
        netmask 255.255.255.0
        gateway 192.168.1.1

As far as I can tell, this should work just fine but my VM cannot ping google.com, however oddly enough it seems to be able to resolve google.com to it's IP just fine.

I'm sure this is something simple, but I need help, thanks in advance!

ping results:

cody@eureka:/$ ping google.com
PING google.com (64.233.171.139) 56(84) bytes of data.
^C
--- google.com ping statistics ---
78 packets transmitted, 0 received, 100% packet loss, time 77025ms

ifconfig results:

cody@eureka:/$ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0c:29:a6:d9:b3  
          inet addr:192.168.0.104  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea6:d9b3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:553 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:105473 (103.0 KiB)  TX bytes:2318 (2.2 KiB)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:a6:d9:bd  
          inet addr:192.168.1.250  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fea6:d9bd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:601 errors:0 dropped:0 overruns:0 frame:0
          TX packets:461 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:53403 (52.1 KiB)  TX bytes:56656 (55.3 KiB)

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
share|improve this question

migrated from serverfault.com Jun 24 at 7:48

This question came from our site for system and network administrators.

1 Answer 1

up vote 2 down vote accepted

Remove the default gateway for eth1. Since that interface is local only you don't need a gateway.

A quick look at your route table will probably show that this is your problem.

share|improve this answer
    
This seems to have worked, thanks! Would you mind shortly elaborating as to why this worked? –  Cody Smith Jun 22 at 4:20
2  
Default gateway is used to route packets for other networks. In this case packets to google.com were routed via the gateway for the private network, and it didn't route the packets anywhere. So, after removing private network default gateway, a working default gateway was used. –  Tero Kilkanen Jun 22 at 7:28
    
Thanks a bunch, I thought that the gateway command was only used to route packets to that particular interface. I didn't realize that Debian would influence how Debian chose the nic to send the traffic through. –  Cody Smith Jun 28 at 9:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.