Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Solved] Server won't connect to network
New Posts  All Forums:Forum Nav:

[Solved] Server won't connect to network

post #1 of 28
Thread Starter 
I am having an issue with my server connecting to the network via a wired connection. Everything worked fine, I updated system on January 7th and after a restart I started to get an error message “Waiting for network configuration.” while the system booted. It would wait 60 seconds and then boot normally, but I have no internet connection, and am unable to ping my router. I have tried switching ethernet cables as well as switching locations on the router, neither of which helped. A quick Google recommended editing the file in /etc/network/interfaces and deleting anything past
Code:
auto lo
iface lo inet loopback

Doing that got rid of the error message but I still cannot ping my router. I then tried adding back
Code:
auto eth0

to the interfaces file which also didn't help. Logs show this line repeated many times
Code:
Server dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval X (xid=0x33be07f7)
Followed by:
Code:
Server dhclient: No DHCPOFFERS received.
Server dhclient: No working leases in persistent database – sleeping
Code:
dan$ ip link eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether $MACADD brd ff:ff:ff:ff:ff:ff

Lastly here is what updated:
Warning: Spoiler! (Click to show)
Code:
Start-Date: 2014-01-07 22:23:48
CommandLine: apt-get upgrade
Upgrade: iproute:amd64 (20121211-2, 20121211-2ubuntu1) libdrm2:amd62, libpixman-1-0:amd64
End-Date: 2014-01-07 22:23:58

Start-Date: 2014-01-07 22:24:37
CommandLine: apt-get dist-upgrade
Install: linux headers-3.8.0-35:amd64, linux-image-extra-3.8.0-35-generic:amd64, linux-headers-3.8.0-35-generic:amd64
Upgrade: linux-generic:amd64, linux-headers-generic:amd64, linux-image-generic:amd64
End-Date: 2014-01-07 22:25:41

The only thing that caught my eye was iproute, but nothing showed up on Google. Is it possible to revert backwards and see if I can get a connection? I was also think of loading Ubuntu to run a live CD and see if I have a connection. Any help would be much appreciated.
post #2 of 28
Make sure this is in your /etc/network/interfaces file:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

IF that doesn't work, then we'll try manually connecting to your network (static).
Router
(12 items)
 
  
Reply
Router
(12 items)
 
  
Reply
post #3 of 28
Thread Starter 
Quote:
Originally Posted by stumped View Post

Make sure this is in your /etc/network/interfaces file:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

IF that doesn't work, then we'll try manually connecting to your network (static).

Added "iface eth0 inet dhcp" to /etc/network/interfaces and it didn't help, still can't ping my router. If I follow the Arch Beginners Guide (I know I am on Ubuntu but used it to reference setting up wired connection) I get the following output
Code:
dan:~$ sudo ip link set eth0 up
dan:~$ sudo ip addr add 192.168.1.100
dan:~$ sudo ip route add default via 192.168.1.1
RTNETLINK answers: Network is unreachable

192.168.1.100 is the static IP address I have set up my router to assign to the server.
post #4 of 28
Quote:
Originally Posted by thestraw0039 View Post

Followed by:
Code:
Server dhclient: No DHCPOFFERS received.
Server dhclient: No working leases in persistent database – sleeping

This means that the router is not running a DHCP server, or it's not replying within a reasonable time, which means you gotta either fix it, or assign a static ip.

Quote:
Originally Posted by thestraw0039 View Post

Quote:
Originally Posted by stumped View Post

Make sure this is in your /etc/network/interfaces file:
Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

IF that doesn't work, then we'll try manually connecting to your network (static).

Added "iface eth0 inet dhcp" to /etc/network/interfaces and it didn't help, still can't ping my router. If I follow the Arch Beginners Guide (I know I am on Ubuntu but used it to reference setting up wired connection) I get the following output
Code:
dan:~$ sudo ip link set eth0 up
dan:~$ sudo ip addr add 192.168.1.100
dan:~$ sudo ip route add default via 192.168.1.1
RTNETLINK answers: Network is unreachable

192.168.1.100 is the static IP address I have set up my router to assign to the server.

out of memory, you could try:
sudo ifconfig eth0 down
sudo ip addr add 192.168.1.1/24
sudo ip route add default via 192.168.1.1
sudo ifconfig eth0 up

then verify that the link is up, the ip address is assigned, and the default route is set up:
sudo ifconfig
ip addr
ip route

example output of a working configuration from my server:
Code:
scrin@silli:~$ sudo ifconfig
eth0      Link encap:Ethernet  HWaddr 00:15:17:82:94:ec                                       ### eth0 visible means the link is up
          inet addr:88.192.75.221  Bcast:88.192.95.255  Mask:255.255.224.0                    ### ip on this line
          inet6 addr: 2001:14b8:1b0:2222::1/128 Scope:Global
          inet6 addr: fe80::215:17ff:fe82:94ec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37263983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57532701 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5978836832 (5.5 GiB)  TX bytes:62842745214 (58.5 GiB)
          Interrupt:18 Memory:b8c20000-b8c40000

eth1      Link encap:Ethernet  HWaddr 00:15:17:82:94:ed
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:17ff:fe82:94ed/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:93168477 errors:0 dropped:10 overruns:0 frame:0
          TX packets:301019275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14510400990 (13.5 GiB)  TX bytes:408220068458 (380.1 GiB)
          Interrupt:19 Memory:b8c00000-b8c20000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:5223241 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5223241 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:794385256 (757.5 MiB)  TX bytes:794385256 (757.5 MiB)

scrin@silli:~$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:15:17:82:94:ec brd ff:ff:ff:ff:ff:ff
    inet 88.192.75.221/19 brd 88.192.95.255 scope global eth0                                                              ### ip address on this line
    inet6 2001:14b8:1b0:2222::1/128 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::215:17ff:fe82:94ec/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:15:17:82:94:ed brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global eth1
    inet6 fe80::215:17ff:fe82:94ed/64 scope link
       valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
    link/sit 0.0.0.0 brd 0.0.0.0
scrin@silli:~$ ip route
default via 88.192.64.1 dev eth0                                                                                           ### default route
88.192.64.0/19 dev eth0  proto kernel  scope link  src 88.192.75.221
192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.1
scrin@silli:~$

if that works, and you can ping your router with: ping 192.168.1.1 that means that these settings work, at least to the router. next step is to ping the outer world, for example, the google dns: ping 8.8.8.8
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
post #5 of 28
Thread Starter 
Alright:
Code:
sudo ifconfig eth0 down
sudo ip addr add 192.168.1.1/24
sudo ip route add default via 192.168.1.1
RTNETLINK answers: Network is down
sudo ifconfig eth0 up

I can ping the router smile.gif, but can't ping www.google.com frown.gif
post #6 of 28
Quote:
Originally Posted by thestraw0039 View Post

Alright:
Code:
sudo ifconfig eth0 down
sudo ip addr add 192.168.1.1/24
sudo ip route add default via 192.168.1.1
RTNETLINK answers: Network is down
sudo ifconfig eth0 up

I can ping the router smile.gif, but can't ping www.google.com frown.gif

Ahh just realized, the interface should had been put up before trying to add the default route. Anyway, if you can ping your router properly, it means that the settings on your server should be set up correctly. The problem now is either in your router's config, or in some other settings of your server. Can you ping 8.8.8.8 ? If you can, the issue is most probably the fact that you don't have DNS servers set up. In this case, check /etc/resolv.conf file. It should contain lines starting 'nameserver'. If not, you need to set up your DNS servers. Your router might offer a DNS server, in which case you should type in (if not already)
Code:
nameserver 192.168.1.1
on a new line. If that don't work, or you don't want to use your routers DNS server, you can try google's public DNS servers. For them, add following:
Code:
nameserver 8.8.8.8
nameserver 8.8.4.4
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
post #7 of 28
Thread Starter 
I can't ping 8.8.8.8, it says Destination Host Unreachable. My router does have a DNS I believe, when I access it (log in via 192.168.1.1) it says:

Connection: DHCP
IP Subnet Mask: 255.255..240.0
Domain Name Server: Lists three numbers in x.x.x.x format.

How do I enter this information in Ubuntu?
post #8 of 28
Quote:
Originally Posted by thestraw0039 View Post

I can't ping 8.8.8.8, it says Destination Host Unreachable. My router does have a DNS I believe, when I access it (log in via 192.168.1.1) it says:

Connection: DHCP
IP Subnet Mask: 255.255..240.0
Domain Name Server: Lists three numbers in x.x.x.x format.

How do I enter this information in Ubuntu?

sudo nano /etc/resolv.conf

and add in three lines:
nameserver first ip address
nameserver second ip address
nameserver third ip address

where you add the same three IP addresses. However, "Destination Host Unreachable" means that there's a routing problem in some part of the network. Most probably your router. To verify routing tables on your server, could you paste in the output of following two commands: route -n and ip route

Oh, also, I suppose your router has NAT enabled? If not, and it's in bridged mode, 192.168.xxx.xxx IP wont work, and you need either a static IP from your operator, or use DHCP. Or enable NAT.

Also, one thing to try:
tracepath 8.8.8.8
and see how far it goes. If it says command not found, you may need to install iputils package (sudo apt-get install iputils)
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
post #9 of 28
Thread Starter 
Code:
$route -n
Kernel IP routing table
Destination     Gateway      Genmask      Flags Metric Ref Use Iface
0.0.0.0         192.168.1.1  0.0.0.0       UG     0      0   0   eth0
192.168.1.0      0.0.0.0    255.255.255.0  U      0      0   0   eth0  

$ip route
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0  proto kernel  scope link src 192.168.1.1

$tracepath 8.8.8.8
1: Server.local           0.211ms pmtu 1500
1: Server.ocal           2998.489ms !H
   Resume: pmtu 1500

When I open /etc/resolv.conf the file reads:

#Dynamic resolve.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

And the three IP addresses you said to put there are the three in the DNS section of the router correct? Is the problem it is looking at 255.255.255.0 where the router subnet mask is 255.255.240.0?
post #10 of 28
Quote:
Originally Posted by thestraw0039 View Post

Code:
$route -n
Kernel IP routing table
Destination     Gateway      Genmask      Flags Metric Ref Use Iface
0.0.0.0         192.168.1.1  0.0.0.0       UG     0      0   0   eth0
192.168.1.0      0.0.0.0    255.255.255.0  U      0      0   0   eth0  

$ip route
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0  proto kernel  scope link src 192.168.1.1

$tracepath 8.8.8.8
1: Server.local           0.211ms pmtu 1500
1: Server.ocal           2998.489ms !H
   Resume: pmtu 1500

When I open /etc/resolv.conf the file reads:

#Dynamic resolve.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

And the three IP addresses you said to put there are the three in the DNS section of the router correct? Is the problem it is looking at 255.255.255.0 where the router subnet mask is 255.255.240.0?

Okay the routing settings seem to be correct, assuming your router indeed have NAT enabled. One thing though, it is possible that your router don't like static IP's. You could try to do: sudo dhclient eth0 and wait if your router or some DHCP server responds. It may take a long time (many minutes) for that to go through.

Do you have other computers connected to the same router, and are they able to access the internet?

If yes, what kind of IP addresses do these have? (10.xxx.xxx.xxx or 192.168.xxx.xxx or something totally different?)
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
Minimachine
(9 items)
 
  
CPUMotherboardGraphicsRAM
i7-5775C Asus Maximus VII Impact EVGA GTX1080 Founders edition 2x8GB Kingston HyperX 1600Mhz 
Hard DriveMonitorPowerCase
Samsung 950 PRO 512GB M.2 NVMe 3x Asus PB287Q 4k Silverstone 600W Strider SFX NCASE M1 Rev 2 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › [Solved] Server won't connect to network