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 am unable to get an internet connection with my static IP setup.

Here's my relevant files:

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=localhost.myserver
GATEWAY=192.168.1.1

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=none
HWADDR=XX:XX:XX:XX:XX:XX
TYPE=Ethernet
UUID=xxxxxxx-xxxxxx-xxxx-xxxx-xxxxxxxx
BROADCAST=192.168.1.255
IPADDR=192.168.1.44
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes  

/etc/resolve.conf

search myserver
nameserver 192.168.1.1
nameserver 8.8.8.8

ifconfig shows 192,168.1.44 (just like it should)

route -n shows:

Destination       Gateway           genmask                 flag     Metric           Ref    Use    Iface
192.168.1.0      0.0.0.0            255.255.255.0           U        0                0      0      eth0
169.254.0.0      0.0.0.0            255.255.0.0             U        1002             0      0      eth0
0.0.0.0          192.168.1.1        0.0.0.0.                UG       0                0      0      eth0

When I ping the gateway I get:

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.44 icmp_seq=1 Destination Host Unreachable
From 192.168.1.44 icmp_seq=2 Destination Host Unreachable
From 192.168.1.44 icmp_seq=3 Destination Host Unreachable

When I ping google, it just hangs until finally saying unknown host.

What's wrong?

share|improve this question
    
Does it work with dynamic IP addresses ? Also, what does arp -an show you ? The problem is most likely in the physical path between the box and gateway. (Can you describe your setup a bit better ?) –  davidgo Jan 24 at 5:05
    
@davidgo I set VirtualBox to "BridgedAdapter" and now it works. It was not working with "NAT" –  Don Rhummy Jan 24 at 5:17

3 Answers 3

You still need to add:

GATEWAY=192.168.1.1 DNS1=8.8.8.8 DNS2=192.168.1.1

to your /etc/sysconfig/network-scripts/ifcfg-eth0 file. It worked for me!

share|improve this answer
up vote 0 down vote accepted

In virtualBox, the static ip does not work with a NAT connection. Switching to "Bridged Adapter" fixed this.

share|improve this answer

Try using the Intel PRO/1000 MT Server on a NAT Network (NatNetwork) first using dhclient to get a DHCP address, Fiddle with hostname, static IP, host, etc. Reboot. Test ifconfig eth0, route -n, hostname, ping, etc. You should not have to switch to Promiscuous mode, however.

share|improve this answer

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.