LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2012, 08:40 AM   #1
sarahER
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Rep: Reputation: Disabled
static ip issue


hello,

I just installed ubuntu 12.04 and I'm trying to set up my internet access. I just have a wired connection so it should be quite simple.
My computer has two interfaces, eth0 and eth1.
I'm not sure which one my wire is plugged into right now.
At first it was working correctly, but then I tried to set a static IP address, and from there it's not working anymore, even if I cancel the modifications I made. I even tried the other interface, and it's not working either. Right now I just want it to work regardless of the interface.

Please help me to figure out what is not working properly.

One thing I'm sure of is that both the cable and the router do work, so it's a linux configuration problem.

Here's what I've done:
I've been to /etc/network/interfaces and I've added the following:
auto eth1
iface eth1 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1

I doubled checked that these are the correct values for my network. Then I did:
/etc/init.d/network restart
and even tried:
ifdown eth1
ifup eth1
I sometimes got the message 'RTNETLINK answers: file exists - error when doing ifup on alias eth1:1 on RHEL5.'

thanks
 
Old 06-19-2012, 10:04 AM   #2
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
Does this not work for in your network and externally? If you ping 192.168.1.1, it wont return anything? Or is it only when trying to connect out?

I have had a problem like that and had to declare the nameservers in /etc/network/interfaces.
auto eth1
iface eth1 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
#I dont know if you have anything internally, just using google's DNS as an example.
dns-nameservers 8.8.8.8 8.8.4.4

Im not sure if you are using Ubuntu Server or Desktop, but this guide may be helpful for you: Ubuntu Server Guide
 
Old 06-19-2012, 10:06 AM   #3
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267

Rep: Reputation: 58
The output from ifconfig would tell us what is actually set up. Please post it between code tags(
Code:
 output
):
 
Old 06-19-2012, 11:33 AM   #4
sarahER
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Sometimes it works just for a while I don't understand what's wrong.
Right now it's not working again.
If I ping the gateway I get an answer from one of my own interfaces (apparently) saying icmp host unreachable.
I can't copy paste so it's hard to copy the whole output of ifconfig. I would have to do it by hand. But if you ask me for a specific line I can give it to you.
It roughly returns:
lo:
127.0.0.1

eth0:
link:ethernet
inet addr: 192.168.1.3 (this address range can only come from the dhcp)
bcast: 192.168.1.255
mask 255.255.255.0

eth1:
192.168.1.100
bcast: 192.168.1.255
mask 255.255.255.0
 
Old 06-19-2012, 12:36 PM   #5
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
I'm out of ideas for the moment, but will try to do some research on what this problem could be/how to solve it. I was just going on previous experiences before. I have had a problem before where the dhclient still has a dhcp lease from the router and will mess with your static settings, but I am not sure...I haven't had a lot of experience in this area.

The more logs/errors you can find or supply would be helpful

I have a bit of work to do, but will look back later today. Hopefully someone can give some help.
 
Old 06-19-2012, 03:58 PM   #6
sarahER
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I forgot to mention something: when I did sudo /etc/init.d/services restart, I also got the message ignoring unknown interface eth0=eth0
 
Old 06-19-2012, 05:10 PM   #7
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
Can you try running this and see if it gives you back the correct results?

lshw -C network
 
Old 06-19-2012, 05:20 PM   #8
sarahER
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
What do you mean by correct results ?
Yes I think it does, that's sort of the hardware I bought, though I wouldn't be sure they're part of the motherboard so I'm not that familiar with the internal names of each motherboard component. But yeah this is it, it's not where the problem comes from.

Last edited by sarahER; 06-19-2012 at 05:25 PM.
 
Old 06-19-2012, 05:42 PM   #9
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
Sorry about that, by correct, just that it noticed the right hardware, and gave the right ethernet interface for what you were using.

I asked this because of what you said before:

"My computer has two interfaces, eth0 and eth1.
I'm not sure which one my wire is plugged into right now."

I was thinking that this would give some information on which interface to troubleshoot. (I am in uncharted territory though, I have some experience with Linux, but have only been at it off and on for a couple years)
 
Old 06-19-2012, 06:03 PM   #10
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
Also, are you using Ubuntu Desktop or Server?
 
Old 06-19-2012, 06:06 PM   #11
sarahER
LQ Newbie
 
Registered: Jun 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I actually found out it's eth0 by unplugging and plugging back and looking at dmesg.
It's the desktop edition

Last edited by sarahER; 06-20-2012 at 01:13 AM.
 
Old 06-20-2012, 10:21 AM   #12
montel
Member
 
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45

Rep: Reputation: 19
I was messing around on my machine at home last night and was thinking it could be a dhclient issue. Your Ubuntu box runs fine on dhcp but not when you want a static IP right?

Try running ps ax | grep dhclient
If it is running, kill the processes, then restart /etc/init.d/networking.

That might help?
 
  


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
static ( one to one ) natting issue in Iptables for RHEL5 ywaikul Linux - Security 6 02-24-2011 01:08 PM
Java non-static variable cannot be referenced from a static context issue rickrvo Programming 2 02-12-2010 03:26 PM
Having an odd issue assigning a static IP in Debian. Rehumanize Linux - Networking 3 07-09-2008 11:30 PM
Using Apache server with non-static IP address issue coldbeer Linux - Server 2 07-06-2007 08:09 AM
Static route issue unixfool Linux - Networking 1 05-19-2006 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:59 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration