LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Slackware DHCP works but cannot ping or access router setup (http://www.linuxquestions.org/questions/linux-networking-3/slackware-dhcp-works-but-cannot-ping-or-access-router-setup-607867/)

RedFox937 12-19-2007 09:47 AM

Slackware DHCP works but cannot ping or access router setup
 
I recently set up a computer with Slackware to run as a small web server. I have installed Slackware on this computer before with no problems, but this time it cannot access the network fully. It gets an address from DHCP, shown by ifconfig and the DHCP table on the router setup accesssed from a different computer. However, I cannot ping any of the other computers or the router and the internet cannot connect. I am relatively new to Linux, but I have worked with Slackware for a few months. Any tips would be greatly appreciated.

bejiita 12-19-2007 10:42 AM

Three letters, DNS

check

/etc/hosts
/etc/resolv.conf
/etc/nsswitch.conf

furthermore try setting a static ip outside of your DHCP pool and go from there

ifconfig ethX xxx.xxx.xx.x

Amuro-Ray2020 12-19-2007 03:01 PM

Route issue
 
DNS might be an issue, but it's unlikely. There's a deeper problem here.

If you're pinging by IP address, which I assume you are, DNS queries don't result in failed pings. You're going to want to check your route table to make sure that your computer knows where to send things. Here's an example of what this should look like:

Code:

tsnow@mymachine:~$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
172.31.0.0      *              255.255.0.0    U    0      0        0 eth0
default        172.31.1.250    0.0.0.0        UG    0      0        0 eth0
myuser@mymachine:~$

There are two entries here that allow my machine to communicate with the rest of the network. The top most entry allows my communication with the local network, while the bottom entry is my default route to access the outside world.

I have seen issues on certain versions of Linux when using the lightweight DHCP servers on routers where the route table entries are not made correctly in certain situations.

As per bejiita's suggestion to check DNS, you'll want to do this too. There's a strong possibility that this wasn't pulled correctly from DHCP as well.

Let us know how things turn out!

RedFox937 12-19-2007 09:33 PM

I looked at the route table and everything looked like it should work correctly. It had the local network and the internet shown, along with the loopback connection. When I tried viewing /etc/hosts it said access denied or something similar, even though I was logged in as root. Maybe I was just trying to access it incorrectly.

RedFox937 12-19-2007 09:43 PM

After rebooting the computer, the loopback connection doesn't show in the route table anymore, in case that would change your response.

Amuro-Ray2020 12-19-2007 10:06 PM

Routing suggestion
 
At this point, I'd try editing the route table by hand using the route command. When I was using Fedora Core 4 on someone's machine, DHCP would pull a valid address, but for some reason, their machine couldn't ping anything. Deleting and re-adding their default routes made everything work again.

Though, when you're adding the gateway address, try this.
Code:

route add -net 0.0.0.0 netmask 0.0.0.0 gw <gateway address>
There's another way to add default gateways to the route table using the route command, but I've had issues with that one. This seems to work the best.

Also, try pinging the address that the DHCP server assigned to your machine, just to see what happens. If it doesn't respond, then there might be bigger problems.

RedFox937 12-23-2007 01:55 PM

I tried the route command, but it did not fix it. I have another linux system running with no trouble, so I compared both the ifconfig result and the route result and the only difference I could find was the computer that works shows on the fourth line (just below the inet6 address) UP BROADCAST NOTRAILERS RUNNING MULTICAST and the one that has trouble does not show "running". Is that simple to fix, or is that just what we have already been trying to fix?

Amuro-Ray2020 12-23-2007 09:31 PM

Wireshark
 
It might be useful for you to grab a copy of wireshark from a working computer, and put it on this slackware box. If you could find out exactly what's happening when you try and send data out, there might be some obvious indications in packet failures.

Otherwise I'm not entirely sure what's going wrong.

davimint 12-24-2007 10:36 PM

RedFox937

Could you please post the stdout for ifconfig.

Quote:

It gets an address from DHCP, shown by ifconfig and the DHCP table on the router setup accesssed from a different computer.
Is this a wireless router or wired ? Does the above "accessed from a different computer" mean that you can "NOT" access the router from the machine that is giving you problems.


All times are GMT -5. The time now is 09:49 AM.