Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Ok, I know this is a simple question but I need to ask it...

I have set up an Apache web server on my home network on a Ubuntu 8.04 Server Edition machine. I just have it working on my home network which is behind a garden-variety Linksys router. I set it up with a static IP today by editing my /etc/network/interfaces file, here is the entry:

auto eth0
iface eth0 inet static
    address 192.168.1.140
    netmask 255.255.255.0
    network 192.168.0.0
    broadcast 192.168.1.255
    gateway 0.0.0.0

The netmask, network, and broadcast values were taken from the ifconfig output when the box was still using DHCP. However, I didn't know what the gateway value is supposed to be so I filled it with 0's. The server now serves pages correctly and predictably but I can't request anything from it. That is, it can't get on the web, can't get to any remote Git repo's etc.

I know I'm missing something simple, can anyone enlighten me?

share|improve this question

closed as off topic by Michael Hampton, mdpc, Jenny D, Iain May 22 '13 at 6:53

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

5 Answers

up vote 11 down vote accepted

The correct network address for an IP of 192.168.1.140/255.255.255.0 is 192.168.1.0, not 192.168.0.0. As for the gateway, it's most likely 192.168.1.1 as Zypher said.

share|improve this answer
    
+1, good catch. –  Eddie Jun 12 '09 at 1:34
    
ahh missed that went right past it to the 0.0.0.0 –  Zypher Jun 12 '09 at 1:42
add comment

You're gateway will be 192.168.1.1 on a linksys router

share|improve this answer
    
Unless you've modified any of the Linksys router's default settings then yes your default gateway would be 192.168.1.1 –  Codejnki Jun 12 '09 at 1:27
    
yep, assumed he hadn't because he didn't know the gateway address –  Zypher Jun 12 '09 at 1:32
add comment

When it's still on DHCP you can determine the default gateway by examining the output of:

route -n

And the correct DNS servers by the output of:

cat /etc/resolv.conf

Also, you don't need (and shouldn't have) the "network" or "broadcast" entries as they only exist for the very rare networks where those settings aren't the default (mostly parts of corporate or university networks that haven't been properly fixed since the early 1990's).

share|improve this answer
add comment

Fix the gateway and network address and you will be able to get on the web. You need a gateway to get on the internet. I don't know what router you have at home, but I suggest looking it up, check the manual and search for the standard IP address to manage the router. 99 % of the times, that's the address you need to enter in the gateway line.

share|improve this answer
add comment

I thing you need to conf at your linksys box at brige then it should work as u needed

Rajat

share|improve this answer
add comment

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