PDA

View Full Version : [SOLVED] No network connection after boot



stava
November 27th, 2010, 06:19 PM
I recently installed Ubuntu Server 10.10. Establishing a network connection during the installation process was problematic, it took me a few attempts to get it working (not that I actually did anything other than retrying). However, now when I boot the server it does not have a network connection. ifconfig says that eth0 is configured, but it doesn't get an IP. So I have to do


sudo ifdown eth0
sudo ifup eth0 192.168.1.103
And it would work. But the same problem will occur when I reboot.

Yes, the router is configured to give this server a static IP. But I've changed /etc/network/interfaces to reflect this. This is my /etc/network/interfaces file:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.1.103
netmask 255.255.255.0
gateway 192.168.1.1ifconfig output (after doing ifdown/ifup):

eth0 Link encap:Ethernet HWaddr 00:24:8c:26:e2:74
inet addr:192.168.1.103 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::224:8cff:fe26:e274/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:322 errors:0 dropped:0 overruns:0 frame:0
TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30644 (30.6 KB) TX bytes:85687 (85.6 KB)
Interrupt:28

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:7 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:612 (612.0 B) TX bytes:612 (612.0 B)

stava
November 27th, 2010, 07:52 PM
I tried adding broadcast 192.168.1.255 in the interfaces file, still have the same problem :(

karthick87
November 27th, 2010, 07:59 PM
Can you post your ouput of resolv.conf file


cat /etc/resolv.conf

stava
November 27th, 2010, 08:02 PM
cat /etc/resolv.conf
nameserver 192.168.1.1

stava
November 27th, 2010, 08:41 PM
I dont know if this is useful:

dmesg | grep eth0
[ 1.404535] eth0: RTL8168c/8111c at 0xffffc90000340000, 00:24:8c:26:e2:74, XID 1c4000c0 IRQ 28
[ 4.187061] r8169: eth0: link down
[ 4.187068] r8169: eth0: link down
[ 4.187335] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 37.175121] r8169: eth0: link down
[ 37.175357] ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 40.608402] r8169: eth0: link up
[ 40.608701] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 50.840029] eth0: no IPv6 routers present

karthick87
November 27th, 2010, 09:14 PM
You should give your DNS server address in resolv.conf file..For your reference see my resolv.conf file


karthick@Ubuntu-desktop:~$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 218.248.255.139
nameserver 218.248.255.146


DNS server address will be different for you.So ask your ISP to know DNS address.

stava
November 27th, 2010, 09:28 PM
You should give your DNS server address in resolv.conf file..For your reference see my resolv.conf file


karthick@Ubuntu-desktop:~$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 218.248.255.139
nameserver 218.248.255.146
DNS server address will be different for you.So ask your ISP to know DNS address.

I dont really see what DNS has to do with this. The router (192.168.1.1) will redirect DNS queries to my ISPs nameservers (or nameservers defined by me).

My desktop computer have the exact same resolv.conf file as this server, and it works.

The problem is that the server dont seem to connect to the network until I do ifdown/ifup manually.

stava
November 28th, 2010, 08:48 AM
Well I tried changing nameservers anyway, it didn't work. :(

stava
November 28th, 2010, 12:08 PM
I just noticed that with the configuration I have in /etc/network/interfaces (see above) I don't need to do

ifdown eth0
ifup eth0 192.168.1.103It's enough to just do

ifdown eth0
ifup eth0So I suspect its not my configuration that is the problem (most of it is default from the installation anyway).

Perhaps a temporary solution would be to run a script each time the system boots which would automate this? However thats done?

Still have the original problem.

stava
November 28th, 2010, 05:52 PM
bump :(

karthick87
November 28th, 2010, 06:02 PM
This is my output,see if it helps you


karthick@Ubuntu-desktop:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
mtu 1500
address 192.168.1.10
netmask 255.255.255.0
broadcast 192.168.1.255

stava
November 28th, 2010, 10:04 PM
This is my output,see if it helps you


karthick@Ubuntu-desktop:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
mtu 1500
address 192.168.1.10
netmask 255.255.255.0
broadcast 192.168.1.255
Thats very similar to my configuration. Even when I change it to match yours it wont connect on boot. :(

uncaspi
November 29th, 2010, 06:40 AM
Do you have default route to the router. Let's see sudo /sbin/route -n

stava
November 29th, 2010, 08:08 PM
Do you have default route to the router. Let's see sudo /sbin/route -n
Here it is (when connected):

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

stava
November 30th, 2010, 02:51 PM
bump!

uncaspi
November 30th, 2010, 03:05 PM
Try to add
ifup eth0
/sbin/route add default gw 192.168.1.1 eth0
in /etc/rc.local before the exit 0 line

reboot

stava
December 1st, 2010, 07:55 PM
Try to add
ifup eth0
/sbin/route add default gw 192.168.1.1 eth0
in /etc/rc.local before the exit 0 line

reboot
It did not work :(

stava
December 1st, 2010, 10:42 PM
I don't know, maybe this is relevant?

$ sudo lshw -class network
*-network
description: Ethernet interface
product: RTL8111/8168B PCI Express Gigabit Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 02
size: 100MB/s
capacity: 1GB/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full ip=192.168.1.103 latency=0 link=yes multicast=yes port=MII speed=100MB/s
resources: irq:28 ioport:c800(size=256) memory:f8eff000-f8efffff(prefetchable) memory:f8ee0000-f8eeffff(prefetchable) memory:feaf0000-feafffff(prefetchable)
$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: No
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes

grahammechanical
December 2nd, 2010, 02:35 AM
From your ifconfig output eth0 is UP and RUNNING. It is working. It has a inet addr which I assume is the address of the router/modem. It has a Broadcast address and a Mask address. All this seems fine. You are connecting to thr router in my opinion. But I have been wrong before.

I am not sure that I understand the problem? Is it not connecting to the Internet? If so, check that the modem/router is set up properly and is connecting to the ISP. Or do you want it to make a connection when you boot? If so, set the connection to Automatically Connect. Do you have network manager installed? Is there a network icon in the top panel to the right? That will let you edit connections. Clicking enable networking should let you connect without typing commands in a terminal.

Regards.

tog10
December 2nd, 2010, 03:03 AM
To all sir,

please help me too!!! In my elearning center(30 system unit) as of now, im use xp ser pack 2 & 3. But i install ubuntu one of my computer. Its double operating system ( ubuntu and xp). My problem is, i cannt connection or open any website in my computer, but i can ping other computer 1, 2, 3, 4 and ....... I want my double operating system can surf internet too...... BY THE MY CONNECTION CONFIG USING STATIC AND MY ROUTER AND SWITCH (CISCO BRAND).. FIREWALL IS OFF ALREADY ALSO...

stava
December 2nd, 2010, 08:57 AM
From your ifconfig output eth0 is UP and RUNNING. It is working. It has a inet addr which I assume is the address of the router/modem. It has a Broadcast address and a Mask address. All this seems fine. You are connecting to thr router in my opinion. But I have been wrong before.

I am not sure that I understand the problem? Is it not connecting to the Internet? If so, check that the modem/router is set up properly and is connecting to the ISP. Or do you want it to make a connection when you boot? If so, set the connection to Automatically Connect. Do you have network manager installed? Is there a network icon in the top panel to the right? That will let you edit connections. Clicking enable networking should let you connect without typing commands in a terminal.

Regards. I do get a connection, internet connection. But ONLY after I have logged in on the server to bring down and up eth0. It does not connect automatically when I boot/start the system.

Also I see that I wrote that I have Ubuntu 10.10 Server edition in the opening post, this is wrong. I have Ubuntu 10.04 LTS

uncaspi
December 2nd, 2010, 09:40 AM
When I had a web server running I put these commands in /etc/rc.local
before exit 0 line.

/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 1922.168.1.10 up
/sbin/route add default gw 192.168.1.1 eth0
echo "nameserver x.x.x.x" > /etc/resolv.conf


And these commands worked for me, but this was a redhat box without any network manager.Btw have you removed network-manager?

stava
December 2nd, 2010, 10:01 PM
I thought I solved it by changing the static IP address to one outside the DHCP range. But I was wrong.

Then I tried uncaspi's solution, and it worked! Thanks a lot.

uncaspi
December 3rd, 2010, 12:13 AM
Glad I could help;)