Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Working my way through understanding Linux.

I still consider myself a newbie. I recently installed a 10.04 server with LAMP and others on it. I wish to get it surfing the net: apt-get update and install webmin.

My setup: Ubuntu 10.04 PC Ubuntu 10.04 SERVER

PC connects to www through WiFi:

netstat -r

Kernel IP routing table
Destination Gateway Genmask Flags Iface * U wlan0 * U eth0
link-local * U eth0

ifconfig -a

eth0 Link encap:Ethernet HWaddr 6c:f0:49:c1:20:48 
inet addr: Bcast: Mask:

Link encap:Local Loopback 
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host


Link encap:Ethernet HWaddr 00:1f:1f:3c:f5:37 
inet addr: Bcast: Mask:

SERVER connects:

Destination Gateway Genmask Flags Iface * U eth0
default UG eth0

When I ping from server:

ping - GOOD
ping - GOOD
ping -b OR 0 - GOOD

in /etc/network/interface

I have defined Gateway as

What am I doing wrong? Does anyone have any idea how to get the server to get to the Internet through the PC? They see each other, the server sees the ip given by the WWW router to the PC but he does not exit through it.

I did some experimenting here trying to replace the gateway with all sorts but with no luck.


up route add -net netmask gw (=router static ip)

How to fix this?

share|improve this question

migrated from Jul 17 '11 at 14:05

This question came from our site for professional and enthusiast programmers.

Havee you enabled ip forwarding (routing) on your PC ? - do sysctl -w net.ipv4.ip_forward=1 – nos Jul 17 '11 at 13:39
Thanx nos,Just did but the situation is at still. I think the problem is with my eth0 configuration. – Jadeye Jul 17 '11 at 22:35
I must admit, I am completely lost. – Jadeye Jul 17 '11 at 22:37

1 Answer 1

I don't see that you have a default gateway defined, I don't have a linux system right here but the routing table should have something like: mask gw gateway_ip (and of course you should be able to reach your gateway from your computer).

Once that you have that, ping something for example, but not the the name URL, do it to its IP. From my home:

With that solved, you only need to set up your dns server IP, in /etc/resolv.conf, or let your dhcp

share|improve this answer
I kind of understand, so let me try please: when you say default gateway, you mean for server? and is for server, what should it be: the router's ip? the station's eth0 ip? the wifi dungle's ip? hence: OR OR – Jadeye Jul 18 '11 at 12:37
Better yet, let me ask: what should /etc/network/interfaces config look like for server? static ip netmask gateway ???.???.???.???... and is there an inet route add -net command added? what is it suppos to look like? – Jadeye Jul 18 '11 at 12:48
Hello Jadeye: Please execute this as root on your system: route add default gw I don't know how to add a new line in this editor, but please realized that you should hit enter after the gw IP (, I am assuming that whatever is at has a route to the internet. If that is the case, please ping, if successful, then ping – MisterWalrus Jul 18 '11 at 19:42
My /etc/network/interfaces just show: auto lo and iface lo inet loopback. – MisterWalrus Jul 18 '11 at 19:46
Hey MisterWalrus, Ok, so for <ENTER> here you do SHIFT+ENTER in the messege box. Q: When you say: "on your system" you mean the PC connected to the web or the server trying to get the gateway? Just to make sure we are on the same page here: SERVER needs web connection PC has web connection through WiFi dungle ip Server ip PC ip Router static ip What do I need to do to get SERVER through to the internet??? And if it is as you say, where do I do "sudo route add default gw"? Server OR PC? Thanx, JadeYe. – Jadeye Jul 18 '11 at 22:22

Your Answer


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.