Click to See Complete Forum and Search --> : Unable to connect to Internet on Mandrake 10 using Linksys WRT54G Router


Spacehamster
01-04-2005, 04:40 AM
This is the second time I've installed Mandrake on my PC, and the way things are going it'll probably be the last. The PC is connected to a WRT54G Router with a lan cable. The details are below:

Router IP: 192.168.1.1
Internet Connection Type: PPoE (in Router Setup)
Router Name: WRT54G
Primary DNS: 203.0.178.191 (provided by ISP)
PC connected to Router via LAN PORT
Alcatel ADSL Modem connected to Router via Internet Port

/etc/sysconfig/network
HOSTNAME=mandrakepc
NETWORKING=yes
GATEWAY=192.168.1.1

/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
MII_NOT_SUPPORTED=no
WIRELESS_ENC_KEY=""
DHCP_HOSTNAME=mandrakepc
NEEDHOSTNAME=yes

/etc/resolv.conf
search 168.1.1
# search 168.1.1 local
nameserver 203.0.178.191
# nameserver 127.0.0.1
# ppp temp entry

/etc/nsswitch.conf
passwd: files nisplus nis
shadow: files nisplus nis
group: files nisplus nis

#hosts: db files nisplus nis dns
hosts: files nisplus nis dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: nisplus
publickey: nisplus
automount: files nisplus
aliases: files nisplus

And here are some pings I tried -

[i][root@mandrakepc root]# ping 192.168.1.1
connect: Network is unreachable

Can anyone assist in helping me find the problem? I really want to migrate to Linux, but if I can't establish a proper internet connection I'll be forced to trudge back into the waiting arms of Micro$oft.

hard candy
01-04-2005, 07:29 AM
Try "ifconfig eth0 up" and then "ifconfig" as "su" or root. See if "ifconfig" shows two connections- localhost and eth0 with an address. If not, then boot up windows and connect to your router. On the Setup page, make sure DHCP server is enabled, and that there is a starting address and the maximum number of users allowed is more than "1".
During installation of Mandrake was it able to connect to the internet for the package upgrades?

Spacehamster
01-04-2005, 06:07 PM
Originally posted by hard candy
Try "ifconfig eth0 up" and then "ifconfig" as "su" or root. See if "ifconfig" shows two connections- localhost and eth0 with an address. If not, then boot up windows and connect to your router. On the Setup page, make sure DHCP server is enabled, and that there is a starting address and the maximum number of users allowed is more than "1".
During installation of Mandrake was it able to connect to the internet for the package upgrades?

I actually tried both these commands (ifconfig eth0 up and ifconfig), as well as pinging the router. They show that the NIC card (eth0) is working quite nicely, but that the PC can't detect the router. This leads me to believe that it's only a configuration problem - which is easy enough to resolve if you use command-line, and stop relying on the rather dodgy Contral Panel GUI supplied with Mandrake.

I didn't download any package upgrades from the internet, so there wasn't the opportunity to test the internet connection during install.

I'm going to take a look at one of my old UNIX textbooks. After all, Linux is roughly based on the UNIX kernel, so perhaps it might contain a few suggestions on how to solve this problem.

retsaw
01-04-2005, 06:50 PM
Does ifconfig show an appropriate IP address (ie. one in the 192.168.1 subnet)?

NEEDHOSTNAME=yes
I'm not sure what this does, but I don't remember ever needing to set something like this and I am using the same router.

Try setting your network up manually, by default the router starts allocating IP addresses from 192.168.1.100, so from 192.168.1.2 up to 192.168.1.99 should be free.

This should get you a working connection if your network card is workingifconfig eth0 192.168.1.10
route add default gw 192.168.1.1and you'll need to add your DNS server to your resolv.conf.

Spacehamster
01-04-2005, 06:55 PM
ifconfig eth0 192.168.1.10
route add default gw 192.168.1.1and you'll need to add your DNS server to your resolv.conf. [/B]

I can't believe it - it worked! I've got an internet connection! Thanks retsaw - it's unbelievable that it took only two lines of code to solve such an annoying problem.

retsaw
01-04-2005, 09:14 PM
That's why it's good to know how to set these things up manually. :)
The strange thing is that it should work with DHCP unless the DHCP server on the router is disabled or it may a bug in Mandrake.

Spacehamster
01-04-2005, 11:24 PM
Originally posted by retsaw
That's why it's good to know how to set these things up manually. :)
The strange thing is that it should work with DHCP unless the DHCP server on the router is disabled or it may a bug in Mandrake.

Retsaw, I think you might've hit upon the cause. The router is configured with PPPoE (ie. username and password), instead of using a DHCP configuration. However, I configured Mandrake to use DHCP.

I've now reconfigured Mandrake to use BOOTP/DHCP, and manually configured a static IP address, DNS and Gateway address. I think that'll solve the problem permanently.

retsaw
01-05-2005, 03:59 AM
That is where the router gets it's setting from, as long as the router is working, there is no need to change that, though mine is set to auto. The option for the DHCP server is further down on that page, however now you have it working there isn't any need to fix the DHCP problem unless you want to.

hard candy
01-05-2005, 09:22 AM
The router is configured with PPPoE (ie. username and password), instead of using a DHCP configuration.

I would suggest reading the Linksys documentation or the help file on the router itself.

The window you are talking about is for the router itself to connect to your ISP server using either PPoE or DHCP. The window farther down on the set up page for the router is to enable DHCP for the client computers in your local network.
You were trying to set up DHCP for the router to connect to your ISP. Linksys has very good setup guides on its web site.

Spacehamster
01-05-2005, 11:41 PM
Originally posted by hard candy
I would suggest reading the Linksys documentation or the help file on the router itself.

The window you are talking about is for the router itself to connect to your ISP server using either PPoE or DHCP. The window farther down on the set up page for the router is to enable DHCP for the client computers in your local network.
You were trying to set up DHCP for the router to connect to your ISP. Linksys has very good setup guides on its web site.

Thanks for the advice. I'll take a look at the Linksys websites and read the guides.

I've actually setup the PC for my mother and father to use - it's an old Pentium 3 550MHz. Far too old to run Win XP, but fast enough to run Mandrake. My father often visits Chinese websites. As Mandrake has Chinese language as part of the default installation, so my father now spends more time surfing the web on Linux than he does on Windows.

Another Linux convert.