LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-02-2004, 07:11 AM   #1
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Rep: Reputation: 0
Cannot connect to internet


Hi! I am a newbie.
I am unable to connect to the net. My Linux system (I use Suse 8.2) has the following setup Linuxsystem --> Hub --> Router --> Modem. Win98 can access Linux system as a Samba server and the Linux system can access win98. What do I need to do to connect to the net?
Thanks in advance.
 
Old 03-02-2004, 07:30 AM   #2
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Well it seems that u have network configured correctly if u can connect to W98 machine.

What IP addresses does your linux/windows machine/router use?

Settings on your linux box:
Do you have your router set as default gateway? (I use this command to do it:
Code:
route add default gw 192.168.2.1
where 192.168.2.1 is IP of my router).

What about name server, how does your /etc/resolv.conf look
make sure there is line
Code:
nameserver 192.168.2.1
 
Old 03-02-2004, 07:44 AM   #3
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
Linux system = 192.168.2.222
Windows system = 192.168.2.33
I am sorry but I do not know the IP of the router

The /etc/resolv.conf has:
domain mylan.com
 
Old 03-02-2004, 07:49 AM   #4
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Go to your windows 98 machine and check its network settings, it should have set gateway (= router) to something (most probably 192.168.2.1). Then u will know IP address of the router, try to ping it from your linux machine, if it works add a line "nameserver 192.168.2.x" to your resolv.conf and add gateway as well (that route command i mentioned before). Then you can try to ping some server in the internet to see if it works.
 
Old 03-02-2004, 07:56 AM   #5
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
The windows machine has two gateway IP: 192.168.2.1 and 202.54.91.33 given by the ISP
 
Old 03-02-2004, 07:59 AM   #6
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Important one is 192.168.2.1, use it in resolf.conf and route command.
 
Old 03-02-2004, 08:08 AM   #7
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
When I gave route add default gw 192.168.2.1
SIOCADDRT: File exists
was displayed.
I added nameserver 192.168.2.1 using vi to /etc/resolv.conf
 
Old 03-02-2004, 08:14 AM   #8
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
It seems that this rule for routing already exists. What do u get when u type just "route"

If its something like
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

it should work, try to ping some internet server.
eg "ping www.linuxquestions.org"

Last edited by muah; 03-02-2004 at 08:19 AM.
 
Old 03-02-2004, 08:25 AM   #9
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
When I typed route I got the following:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

When I typed ping www.linuxquestions.org I got:
ping: unknown host www.linuxquestions.org
 
Old 03-02-2004, 08:29 AM   #10
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Try "ping 192.168.2.1"
if it works try "ping 64.179.4.146"
this is IP address of linuxquestions, then we can see if its problem with dns settings or something else.
 
Old 03-02-2004, 08:37 AM   #11
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
When I typed ping 192.168.2.1 I got
PING 192.168.2.1 (192.168.2.1) from 192.168.2.222 : 56(84) bytes of data.
64 bytes from 192.168.2.1: icmp_seq=1 ttl=30 time=3.13 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=30 time=1.63 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=30 time=1.63 ms
64 bytes from 192.168.2.1: icmp_seq=4 ttl=30 time=1.63 ms
64 bytes from 192.168.2.1: icmp_seq=5 ttl=30 time=1.63 ms
64 bytes from 192.168.2.1: icmp_seq=6 ttl=30 time=1.63 ms
64 bytes from 192.168.2.1: icmp_seq=7 ttl=30 time=1.64 ms
64 bytes from 192.168.2.1: icmp_seq=8 ttl=30 time=1.62 ms
64 bytes from 192.168.2.1: icmp_seq=9 ttl=30 time=1.62 ms
64 bytes from 192.168.2.1: icmp_seq=10 ttl=30 time=1.62 ms
64 bytes from 192.168.2.1: icmp_seq=11 ttl=30 time=1.63 ms

--- 192.168.2.1 ping statistics ---
11 packets transmitted, 11 received, 0% loss, time 10096ms
rtt min/avg/max/mdev = 1.625/1.769/3.137/0.432 ms


When I typed ping 64.179.4.146 I got
PING 64.179.4.146 (64.179.4.146) from 192.168.2.222 : 56(84) bytes of data.
64 bytes from 64.179.4.146: icmp_seq=1 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=2 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=3 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=4 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=5 ttl=45 time=386 ms
64 bytes from 64.179.4.146: icmp_seq=6 ttl=45 time=388 ms
64 bytes from 64.179.4.146: icmp_seq=7 ttl=45 time=388 ms
64 bytes from 64.179.4.146: icmp_seq=8 ttl=45 time=388 ms
64 bytes from 64.179.4.146: icmp_seq=9 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=10 ttl=45 time=388 ms
64 bytes from 64.179.4.146: icmp_seq=11 ttl=45 time=387 ms
64 bytes from 64.179.4.146: icmp_seq=12 ttl=45 time=431 ms

--- 64.179.4.146 ping statistics ---
13 packets transmitted, 12 received, 7% loss, time 12117ms
rtt min/avg/max/mdev = 386.913/391.454/431.582/12.141 ms
 
Old 03-02-2004, 08:45 AM   #12
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
Well it proves that you can connect to the internet but you have problem with DNS settings. There are a few options what can be wrong:
- can u check again if "name server 192.168.2.1" has been added correctly to /etc/resolv.conf? You can also put '#' (=make it a comment) before "domain mylan.com" in it, I dont think there is a purpose for having it there.

- you can also check settings on W98 machine and see what name servers it uses / and have the same in resolv.conf - maybe your router doesnt work as DNS proxy and u have to enter name servers of your ISP.
 
Old 03-02-2004, 08:51 AM   #13
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
When I typed cat /etc/resolv.conf I got:
nameserver 192.168.2.1
domain mylan.com

In the Win98 machine under DNS configuration there are two IP: 202.54.12.163 and 202.54.12.3 both given by the ISP.
 
Old 03-02-2004, 08:54 AM   #14
muah
Member
 
Registered: Aug 2003
Location: Europe
Distribution: Slackware (current)
Posts: 228

Rep: Reputation: 33
try to use those IPs given by ISP then - add both of them to resolf.conf in the same way u added 192.168.2.1.
 
Old 03-02-2004, 08:59 AM   #15
alaateb
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Original Poster
Rep: Reputation: 0
After adding the two IP when I typed cat /etc/resolv.conf I got:
nameserver 202.54.12.163
nameserver 202.54.12.3
nameserver 192.168.2.1
domain mylan.com
 
  


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
When i connect on the internet I want root not to access the internet !! skouket Linux - Security 12 07-10-2005 12:17 PM
Messed up my Internet Settings (can't connect to the internet) Almazick Linux - Wireless Networking 0 09-07-2004 06:23 PM
can't connect to the internet:linux dont read my internet address droplsh Linux - General 1 02-29-2004 07:32 PM
Can connect broadband but can't connect Internet satimis Linux - Networking 4 01-31-2004 07:58 PM
Can't connect to Internet Galphar Linux - Newbie 13 08-24-2003 03:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:54 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