LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-01-2008, 03:36 PM   #1
neilneil2000
LQ Newbie
 
Registered: Jun 2008
Distribution: Ubuntu Hardy Heron 8.04
Posts: 25

Rep: Reputation: 15
Arrow Static IP works from ifconfig but not /etc/network/interfaces


Hi,

I am having problems with assigning a static IP to my machine.

my /etc/network/interfaces looks like this

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.5
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
When the machine boots ifconfig gives this output

Code:
eth0 Link encap:Ethernet HWaddr 00:1c:c0:45:1d:f2
     inet addr:192.168.1.5 Bcast:192.168.1.255 Mask 255.255.255.0
     inet6 addr: *BLAH*
     UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
     RX packets:0 errors:0 dropped:4294967288 overruns:0 frame:0
     TX packets:0 errors:0 dropped:138 overruns:0 carrier:0
     collisions:0 txqueuelen:1000
     RX bytes:0 (0.0 B) TX Bytes:0 (0.0 B)
     Interrupt:20 Base address:0xa000
and ping 192.168.1.1 gives

Code:
From 192.168.1.5 icmp_seq=2 Destination Host Unreachable
However if I change the /etc/network/interfaces file to read

Code:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
everything works, and running

Code:
ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
sets the static IP up and it works.

I don't understand what is going on here!
 
Old 06-01-2008, 04:27 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
I am not sure which distribution you are using, but it could be that when you try to configure your ethernet with a static IP address, the routing table does not get set correctly. When you have your static declarations in effect, and then reboot, what does the output of
Code:
netstat -rn
show you? It ought to have only a few lines, like this:
Quote:
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
 
Old 06-02-2008, 07:50 AM   #3
sbs
LQ Newbie
 
Registered: Jun 2007
Posts: 3

Rep: Reputation: 0
I don't have a solution for you, but I can tell you what you need to look at.

First of all:
RX packets:0 errors:0 dropped:4294967288 overruns:0 frame:0
TX packets:0 errors:0 dropped:138 overruns:0 carrier:0

So do some googling on problems with all packets being dropped.


And secondly, we know your static IP address is working after the DHCP client has set everything up, but what happens if you try setting it up completely manually?
 
Old 06-03-2008, 03:43 PM   #4
neilneil2000
LQ Newbie
 
Registered: Jun 2008
Distribution: Ubuntu Hardy Heron 8.04
Posts: 25

Original Poster
Rep: Reputation: 15
Hi guys,

Thanks for your ideas, I tried them and couldn't find anything wrong...but I have since found out there are driver issues with this Ethernet controller so I assume its that that's causing this odd behaviour. I have installed a PCI ethernet card and now all is well!

Thanks again people!
 
Old 06-03-2008, 03:44 PM   #5
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
That could explain the *very large* number of dropped packets on the incoming side of your link and 0 on the outbound side.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
changed router wireless essid, /etc/network/interfaces no longer works! snow_bound Linux - Wireless Networking 0 12-29-2006 07:21 AM
Manual Network Setup Works, /etc/network/interfaces doesn't verdeboy2k Linux - Wireless Networking 0 05-31-2006 07:56 PM
IFConfig and static IP Buto Slackware 4 10-21-2004 04:47 PM
Setting up static IP using ifconfig firefly2442 Linux - Networking 6 07-19-2004 10:57 AM
ifconfig: From DHCP to static IP koyi Linux - Networking 5 09-02-2003 05:08 AM


All times are GMT -5. The time now is 11:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration