You are not logged in.

#1 2014-03-02 23:14:42

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

[Solved]Can't Ping External Addresses, Static IP

I've just set up static IP on ethernet on my server, tucked neatly under the bed.
Ping is fine internally, as is ssh:

ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.322 ms
^C
--- 192.168.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.322/0.322/0.322/0.000 ms

However pinging external addresses, doesn't seem to work:

# ping 8.8.8.8
connect: Network is unreachable

Other machines on the network can ping 8.8.8.8

Router is nameserver and default gateway:

# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 192.168.0.1
# ip addr
2: e0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:1c:25:95:60:54 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global e0
       valid_lft forever preferred_lft forever
    inet6 fe80::21c:25ff:fe95:6054/64 scope link
       valid_lft forever preferred_lft forever

The firewall doesn't seem to be the problem either:

# iptables -L -nv
Chain INPUT (policy ACCEPT 4560 packets, 552K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 2147 packets, 280K bytes)
 pkts bytes target     prot opt in     out     source               destination

Of course I uninstalled all dhcp clients before setting up static out of sheer optimism.

Probably unrelated, but worth mentioning: DNS doesn't work either, even though other clients can get DNS through the router.

Any thoughts?

Last edited by dizzi90 (2014-03-03 15:55:30)


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

#2 2014-03-03 07:00:17

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [Solved]Can't Ping External Addresses, Static IP

Check your routing table using the "ip route" command and ensure external adresses aren't being routed through the wrong interface (or your default gateway is set incorrectly or something among those lines).


Burninate!

Offline

#3 2014-03-03 09:11:59

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

Re: [Solved]Can't Ping External Addresses, Static IP

When I've set the ip for the NIC, I've used the following command:

ip addr add 192.168.0.100/24 broadcast 192.168.0.255

and then I have issued:

ip route add default via 192.168.0.1

Where 192.168.0.1 is the router.
Is there any other manual routing which has to be set up?

EDIT: wrong broadcast.

Last edited by dizzi90 (2014-03-03 09:16:05)


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

#4 2014-03-03 10:19:13

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [Solved]Can't Ping External Addresses, Static IP

Could you post the full output of "ip route"?


Burninate!

Offline

#5 2014-03-03 10:29:31

x1site
Member
Registered: 2013-10-20
Posts: 60

Re: [Solved]Can't Ping External Addresses, Static IP

try change your dns servers to 8.8.8.8 in resolv.conf


awesome + rofi

Offline

#6 2014-03-03 11:11:02

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

Re: [Solved]Can't Ping External Addresses, Static IP

Gcool wrote:

Could you post the full output of "ip route"?

I'll post as soon as I get home.
Last time I checked I'm pretty sure, it showed 0.0.0.0 -> 192.168.0.1 and not much else.


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

#7 2014-03-03 15:32:25

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

Re: [Solved]Can't Ping External Addresses, Static IP

# ip route
192.168.0.0/24 dev e0  proto kernel  scope link  src 192.168.0.100

e0 is the ethernet NIC.


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

#8 2014-03-03 15:55:04

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

Re: [Solved]Can't Ping External Addresses, Static IP

[Solved]

ip route add default via 192.168.0.1

I had done it earlier, but I guess it needed doing again.


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

#9 2014-03-03 15:57:51

dizzi90
Member
From: Oslo
Registered: 2013-09-22
Posts: 8

Re: [Solved]Can't Ping External Addresses, Static IP

# ip route
default via 192.168.0.1 dev e0
192.168.0.0/24 dev e0  proto kernel  scope link  src 192.168.0.100

is how it is supposed to look. For future reference.


as0 - [arch][server][btrfs | jbod 320gb][samba][Thinkpad T61p]
franklin - [arch][client][btrfs | raid1-ssd120gb/hdd250gb][Dell Latitude E4300]
galileo - [android][client]

Offline

Board footer

Powered by FluxBB