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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-19-2012, 08:40 AM
|
#1
|
LQ Newbie
Registered: Jun 2012
Posts: 5
Rep:
|
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
|
|
|
06-19-2012, 10:04 AM
|
#2
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
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
|
|
|
06-19-2012, 10:06 AM
|
#3
|
Member
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS7
Posts: 267
Rep:
|
The output from ifconfig would tell us what is actually set up. Please post it between code tags( ):
|
|
|
06-19-2012, 11:33 AM
|
#4
|
LQ Newbie
Registered: Jun 2012
Posts: 5
Original Poster
Rep:
|
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
|
|
|
06-19-2012, 12:36 PM
|
#5
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
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.
|
|
|
06-19-2012, 03:58 PM
|
#6
|
LQ Newbie
Registered: Jun 2012
Posts: 5
Original Poster
Rep:
|
I forgot to mention something: when I did sudo /etc/init.d/services restart, I also got the message ignoring unknown interface eth0=eth0
|
|
|
06-19-2012, 05:10 PM
|
#7
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
Can you try running this and see if it gives you back the correct results?
lshw -C network
|
|
|
06-19-2012, 05:20 PM
|
#8
|
LQ Newbie
Registered: Jun 2012
Posts: 5
Original Poster
Rep:
|
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.
|
|
|
06-19-2012, 05:42 PM
|
#9
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
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)
|
|
|
06-19-2012, 06:03 PM
|
#10
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
Also, are you using Ubuntu Desktop or Server?
|
|
|
06-19-2012, 06:06 PM
|
#11
|
LQ Newbie
Registered: Jun 2012
Posts: 5
Original Poster
Rep:
|
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.
|
|
|
06-20-2012, 10:21 AM
|
#12
|
Member
Registered: Jun 2012
Location: Canada
Distribution: Ubuntu/Debian/CentOS
Posts: 45
Rep:
|
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?
|
|
|
All times are GMT -5. The time now is 09:59 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|