Linux - NewbieThis 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.
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.
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.'
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
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
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.
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.
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)
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.