Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After network-manager could not connect to my router which has IP 192.168.1.1.

I set static ip for my interface. It connects but I cannot ping. I get "Destination host unreachable" whenever I ping from this particualar pc. I can ping and connect fine with same interface and router with my laptops when wired though.

I have set interface ip as:

auto eth0
iface eth0 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

How can I make my pc connect with internet? Please Help

EDIT: ifconfig ifconfig

ip route ip route

ethtool ethtool

traceroute traceroute

The mii-tool one said unsupported.

share|improve this question

closed as too localized by Marco Ceppi Feb 3 '12 at 1:00

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
what's the output of ifconfig when you type it into a terminal? Which adapter is wireless and which is wired? eth0 is normally wired. –  jozzas May 23 '11 at 4:12
    
its wired and its an old desktop pc with external NIC. ifconfig shows me interface with all the ips I set. –  sagarchalise May 23 '11 at 4:17
    
So you only have eth0? There are no other interfaces or ports? If so, and if your other machines can access the router, it may be a hardware problem. –  jozzas May 23 '11 at 4:19
    
yes and It used to connect fine until yesterday –  sagarchalise May 23 '11 at 4:27
    
Sounds like a hardware problem then. Have you checked that ethernet cable recently? Maybe a chair rolled over it in the last day or so. Does the cable work with your laptop? Are you using the same port on your router each time? –  jozzas May 23 '11 at 4:34
show 7 more comments

1 Answer 1

  1. I assume that when you say 'connects' you mean link-up on the interface ports of your PC and router.
    However, I don't understand why that should happen only after you use static-IP -- maybe your interface was configured down initially.

  2. If your router IP is 192.168.1.1 it is very likely to be a Class-B subnet configuration.
    This means the netmask would be 255.255.0.0.
    By using a Class-C netmask and a network number of 192.168.1.0,
    you have placed your PC in a different subnet from your router.
    That would explain the ping unreachable case.

So, I think you should try with,

iface eth0 inet static  
    address 192.168.1.2  
    netmask 255.255.0.0  
    network 192.168.0.0  
    broadcast 192.168.255.255  
    gateway 192.168.1.1  

You can check the physical connectivity with mii-tool.
It is part of the net-tools package.

share|improve this answer
1  
Why should it be Class-b? –  Pitto May 23 '11 at 10:28
    
No, the 192 block is a bank of class C addresses and your home router uses a netmask of 255.255.255.0. –  psusi May 23 '11 at 13:42
1  
For many networks, you can't assume any prefix length based on the IP address any more. This is an assumption network equipment and stacks made before classless networks were common. I think most home routers would set 192.168.x.x as a Class C, though, based on legacy pre-CIDR stuff. –  belacqua Oct 28 '11 at 7:01
add comment

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