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 12-20-2004, 03:30 PM   #1
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Rep: Reputation: 15
Can't access internet through router!!!


Hello people,

I'm having trouble connecting to the internet through my router. I used slackware 9.1 a little while back and was able to set up everything correctly. I thought I had everything i needed when i switched to slackware 10 but apparently i'm forgetting something and I can't figure out what it is.

My network card eth0 is set up correctly. I can even log into my router ( 192.168.0.1 ) through the browser, but my browser won't connect to internet for some reason.

I set up in /etc/rc.d/rc.4 eth0 as such

ifconfig eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255 up

That seems to work fine since I get the eth0 and loopback device on ifconfig command set up as they should be.

My iptable looks like this:

Code:
Destination      Gateway        Netmask         blah blah   interface
192.168.0.0      0.0.0.0     255.255.255.0                          eth0
127.0.0.0          0.0.0.0         255.0.0.0                              lo
0.0.0.0           192.168.0.1      0.0.0.0                                eth0
Is there any missing route? My router takes care of connecting to internet through my adsl modem and that part works correctly since I have access to internet on WindowsXP through my router.

I looked around quite a bit but I can't seem to hit anything that does the trick and I definately don't rememeber how I set things up other than this on my slackware 9.1.

Any help would be greatly appreciated.
Thank you in advance

aXoneX
 
Old 12-20-2004, 05:30 PM   #2
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
Can you ping websites via ip address? Have you looked at /etc/resolv.conf?
good luck.
 
Old 12-20-2004, 06:43 PM   #3
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
Nope, I can't ping anything behind my router. I can ping my own self at 192.168.0.2 and I can also ping the router but nothing beyond the router.

aXoneX
 
Old 12-21-2004, 06:37 AM   #4
Peacedog
Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,292

Rep: Reputation: 167Reputation: 167
What is the output of the following commands?

ifconfig -a

route -n

iptables -L

good luck.
 
Old 12-21-2004, 06:46 AM   #5
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

edit ur /etc/resolv.conf and put an entry there like this

nameserver <ipaddress of ur DNS server>

and then try connecting
 
Old 12-21-2004, 10:58 AM   #6
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
Alright here's the actual output of the commands:

ifconfig -a

Code:
eth0      Link encap:Ethernet  HWaddr 00:0F:1F:A4:36:AD  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Memory:faff0000-fb000000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:692 errors:0 dropped:0 overruns:0 frame:0
          TX packets:692 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:34600 (33.7 Kb)  TX bytes:34600 (33.7 Kb)
route -n

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.0.1     0.0.0.0         UG    1      0        0 eth0
iptables -L

Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
As for the resolv.conf, where could I find the DNS name? I know the IP addresses ( primary
and secondary ) but I don't know the names. Can I just put the primary IP address in there?

aXoneX
 
Old 12-21-2004, 11:17 AM   #7
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hi there

what are primary and secondary IP addresses??

u can ask ur ISP to give u the DNS sever IP

regards
 
Old 12-21-2004, 11:46 AM   #8
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
If I remember correctly, they are just a safety measure. If the primary DNS IP address fails fore a reason or another, then the system can fall back onto the secondary one.

aXoneX
 
Old 12-21-2004, 12:44 PM   #9
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
Quote:
Originally posted by aXoneX
If I remember correctly, they are just a safety measure. If the primary DNS IP address fails fore a reason or another, then the system can fall back onto the secondary one.

aXoneX
ooohhh!!
i was also concerned with the primary DNS and secondary DNS IP address

actually i got confused since u did not mention primary DNS and secondary DNS,instead u mentioned primary IP add and secondary IP address

yes u need to ut that in ur resolv.conf like this

nameserver <ip add of primary DNS>
nameserver <ip add of secondary DNS>

regards
 
Old 12-21-2004, 01:47 PM   #10
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
Quote:

ooohhh!!
i was also concerned with the primary DNS and secondary DNS IP address

actually i got confused since u did not mention primary DNS and secondary DNS,instead u mentioned primary IP add and secondary IP address

yes u need to ut that in ur resolv.conf like this

nameserver <ip add of primary DNS>
nameserver <ip add of secondary DNS>
Hmmm, but when you say "nameserver" do you mean to actually WRITE "nameserver" or do I have to
find the specific name of the server associated with their respective IP addresses?

Regards
aXoneX
 
Old 12-21-2004, 02:04 PM   #11
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
the entry should be like this

nameserver 221.212.11.212

the above in an example IP
where the ip address is the ip address of ur primary DNS server
similarly put the IP address of ur secondary DNS server also

regards
 
Old 12-21-2004, 02:41 PM   #12
Homer Glemkin
Member
 
Registered: Nov 2004
Distribution: Ubuntu, CentOS
Posts: 50

Rep: Reputation: 15
Do you have the cables in the right ports of your router? With some routers you can't use the wan port on it when networking.
 
Old 12-21-2004, 03:46 PM   #13
AUSanders79
Member
 
Registered: Aug 2003
Location: Alabama
Distribution: Slack 10.1/FreeBSD 5.4
Posts: 37

Rep: Reputation: 15
Is IP_FORWARD turned on so that packets are forwarded? Also, is this really a router? Most normal router configs have two NIC's I thought. One for LAN and one for WAN. Are all the right interfaces up? Just a couple thoughts. Good luck!!

**EDIT - I think I completely misunderstood. You're not using the Slack box as a router are you? What kind of router do you have?

Last edited by AUSanders79; 12-21-2004 at 03:48 PM.
 
Old 12-21-2004, 04:08 PM   #14
aXoneX
LQ Newbie
 
Registered: Jun 2004
Distribution: Slackware, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
Talking

Sweet irony!!!!

resolv.conf did it!

I wonder why we have to specify the nameserver though. Shouldnt this be transparent to linux?? My router takes care of the connecting to the ISP part ( I had to specify the account number and password and such to connect to my DSL account and also the DNS IP's in my router already so it can connect to my service properly ). Why does linux need the nameserver IP addresses? All it needs to know is that its talking with the router; the router does the rest....isnt this how this works?

Thanks a bunch for the help everybody but mostly masand .

Regards
aXoneX
 
Old 12-21-2004, 04:11 PM   #15
AUSanders79
Member
 
Registered: Aug 2003
Location: Alabama
Distribution: Slack 10.1/FreeBSD 5.4
Posts: 37

Rep: Reputation: 15
your computer has to do DNS lookups. In Windows, DHCP will set the DNS server for (basically like adding a nameserver in resolv.conf on linux). so you have to add a nameserver to every linux box in resolv.conf or else your PC doesn't know where to go to send DNS lookups. Your router just provides internet connection. Now it may can act as a DNS server and you maybe able to just put 192.168.0.1 in your resolv.conf, but every PC has to have a DNS server specified. Glad you got it worked out!
 
  


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
Can't access internet thru router fpperryaz Linux - Wireless Networking 7 07-17-2005 09:38 AM
Cannot access Internet through SUSE 9.2 Pro router nexangelus Linux - Networking 3 02-08-2005 10:58 AM
Ok, let's try this again. New Mandrake install. Can't access router/internet! Mateo1041 Linux - Newbie 25 11-20-2004 09:35 AM
can't access internet via router stormadvisor Linux - Networking 5 11-05-2004 06:36 PM
Internet access through router and wifi connection caudalie Linux - Wireless Networking 3 01-22-2004 03:51 PM


All times are GMT -5. The time now is 04:05 PM.

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