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.

Is this possible? If so how do I set my static local ip to 192.168.0.2?

Right now im using this in my /etc/network/interfaces

iface eth0 inet static
address 192.168.0.2 
netmask 255.255.255.0  
gateway 192.168.0.1

But it doesnt seem to work because I cannot ping anything.

When I enter ifconfig it doesnt even show eth0. I have no clue what is causing this.

share|improve this question
2  
For a start your default gateway not in your network. Your ip should be probably 192.168.1.2 or gateway's IP should be 192.168.0.1 or DHCP server on the router configured incorrectly, which I find highly not probable. –  Vick Vega Mar 27 '11 at 21:05
    
To be honest I doubt I even set the gateway right. The computer is connected to a router that can be accessed from 192.168.0.1 if that is any help. –  Kraffs Mar 27 '11 at 21:07

1 Answer 1

up vote 2 down vote accepted

eth0 might not be up?

  1. make sure you have a line saying "auto eth0" in your interfaces file.
  2. in order to activate the interface right away, do "ifup eth0". This that doesn't make your interface show up in ifconfig (or produce an error message) there is something more fundamental amiss.
share|improve this answer
    
I got it to work temporarily with "ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.10.255" and "route add -net 0.0.0.0 gw 192.168.0.1 eth0". I have no lien saying "auto eth0" in my interfaces file though. Will adding it solve the problem? –  Kraffs Mar 27 '11 at 21:17
    
Adding auto eth0 seemed to solve this problem. Thank you :) –  Kraffs Mar 27 '11 at 21:19

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.