Linux get IP address but can not connect to internet
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Linux get IP address but can not connect to internet
Dear friends
I have installed Red Hat Fedora 4 on Sharp LapTop.
And recompiled the kernel in order to get working
ethernet card.
I have DSL connection with external router.
As I see from "ifconfig" command, the connection
with server is established, but I can't connect to
internet. Here is the details of network configuration.
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:400:75:41:1E
inet addr:172.17.0.100 Bcast:172.17.255.255
Mask:255.255.0.0
inet6 addr: fe80::240:d0ff:fe75:411e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:342 (342.0 b) TX bytes:536 (536.0 b)
Interrupt:5 Base address:0xe000
try 216.239.39.99 in a browser, that's google's IP if it works then probably your DNS settings, look into adding the correct DNS servers into /etc/resolve.conf
Putting google's IP address in browser, didn't succeed.
At start up, Linux says "can't get IP address for eth0,
check cable?". And I activate the device manually, in
Fedora's "networking hardware configuration" utility.
Pinging this address also says "network is unreachable".
The "/etc/resolve.conf" file doesn't exist in etc folder.
Should I create it by myself?
Dear okmyx, I didn't set default gateway address?
I did it when I was in my school laboratory.
Do I need to set it?
Putting google's IP address in browser, didn't succeed.
At start up, Linux says "can't get IP address for eth0,
check cable?". And I activate the device manually, in
Fedora's "networking hardware configuration" utility.
Pinging this address also says "network is unreachable".
The "/etc/resolve.conf" file doesn't exist in etc folder.
Should I create it by myself?
Dear okmyx, I didn't set default gateway address?
I did it when I was in my school laboratory.
Do I need to set it?
Thanks
Bataa
Hi,
It looks as if you are indeed using dhcp. You will need to setup the eth0 device with a IP and route. Along with dns.
The "/etc/resolv.conf" should have your dns IP. You can create it with a text editor.
i got connection after adding route IP address.
here is route information for my connection: Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
1 thing here is what is about #replace xs' with gw IP address.
Do I need to execute this command, even after getting
connection?
i got connection after adding route IP address.
here is route information for my connection: Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
1 thing here is what is about #replace xs' with gw IP address.
Do I need to execute this command, even after getting
connection?
Again, thank you for your kind help.
Bataa
Hi,
I'm glad to hear you got it! As for the confusion about the xxx.xxx.xxx.xxx , I meant for you to replace the xs' with your gw IP address. If for example your gw was 192.168.0.1 then do a;
I have done the same, (having same situation), but there is a strange situation now.
I see that I am able to connect to a given IP. It's obvious it cannot request nslookup. What to do now?
I made myself root, adm, bin, sys group member. But anyhow, I am not able to connect via domain name (google.com eg.) before I ask it with IP.
P.S.: I can nslookup with my account on command line. Problem is about domain names. (web browser and wget -commandline- can not gather info by domain names)
Anyway, I found a way out. I have set just my university's DNS as DNS and DNS-nameservers. (only for one IP for each) I have deleted 192.168.1.1 then it is up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.