Click to See Complete Forum and Search --> : Debian router -> can't ping LAN


xjussix
03-14-2003, 04:21 AM
I have set up a traditional configuration. Debian box has two network cards, eth0 = ip from ISP(dhcp), eth1 LAN. Then in my main box I have a network card obviously and a crossover cable in between. (I think:D)

Here's what ifconfig says:
eth0 Link encap:Ethernet HWaddr 00:A0:24:EB:31:F9
inet addr:80.223.231.121 Bcast:80.223.239.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:443 errors:0 dropped:0 overruns:0 frame:0
TX packets:87 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:107614 (105.0 KiB) TX bytes:7441 (7.2 KiB)
Interrupt:5 Base address:0x220

eth1 Link encap:Ethernet HWaddr 00:20:AF:42:3C:B3
inet addr:192.168.10.1 Bcast:192.168.10.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:27 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:1134 (1.1 KiB)
Interrupt:10 Base address:0x300

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:48 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4844 (4.7 KiB) TX bytes:4844 (4.7 KiB)

When I try to ping my main box(192.168.10.2), I get nothing. When I hit ctrl+c it says 100% packet loss.
When I ping the router box from the main box(WinXP) ping says "Request timed out" IIRC.

I've now turned the net upside down (slightly exaggerating here..;)) and I'm all out of ideas. All I can think is the cable between the computers isn't crossover after all.

Any help is very much appreciated.

ethar
03-14-2003, 04:50 AM
Does the cable say "Crossover" on it anywhere?

Carl Pender
03-14-2003, 09:09 AM
Do you have Ip forwarding enabled? If not type in the command;
echo 1 > /proc/sys/net/ipv4/ip_forward

You might have change the iptables as well (presuming you have iptables and not ipchains). To enable ip forwarding try the commands

iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT

The eth0 might have to be changed to eth1 in the last command. I'm not sure but this might work.

I had a similar problem and it worked for me.

Ihope this helps:D

xjussix
03-14-2003, 01:16 PM
The cable is a proper crossover cable, that is now confirmed.

ip forwarding is set on by the iptables script. The script is taken from the Frozentux iptables tutorial, so it should be ok.
I have no ideas anymore regarding this problem.

Let me know if you need to get some more info, I'd gladly share!

TigerOC
03-14-2003, 05:05 PM
I have also battled with this over some weeks using a dialup system. I finally solved the problem this week using a script from an article written by David Ranch called Linux IP Masquerade how to. The key was to get the script to activate on boot. I put the script (rc.firewall) in /etc and symlinked it to /etc/rc2.d, rc3.d, rc4.d and rc5.d. The instruction was;
ln -s /etc/rc.firewall /etc/rc2.d/S90rc.firewall

When working you should see all the lines in the script being executed on boot.

xjussix
03-14-2003, 05:28 PM
The iptables script is executed nicely at bootup, no probs with it. Besides, if I ping from the router the work pc I don't think it matters if I have iptables/port forwarding even set up.

Strike
03-14-2003, 06:22 PM
Are your routing tables set up correctly?

camelrider
03-14-2003, 07:23 PM
Two rather obvious questions..
1) Do the lights come on on the netowrk cards at each end of the crossover cable? Could it be a faulty cable/connector?
2) Did you configure WinXP to deal with the network card?

xjussix
03-15-2003, 01:39 AM
Yep, the lights come on. XP is set up in the following way:
IP 192.168.0.2 Netmask 255.255.255.0 GW 192.168.0.1

xjussix
03-15-2003, 02:52 PM
Routing table, how should it look like in my case?

eth0 gets ip from my ISP's dhcp server (IP 80.223.224.1, subnet mask 255.255.240.0)
eth1 is 192.168.1.1, which is then connected to the main computer.

TigerOC
03-15-2003, 04:15 PM
There is something wrong with your network addresses unless there is typo;
Your eth1 is 192.168.10.1 but XP is set 192.168.0.2 and the gateway is 192.168.0.1. I had similar problems and found that if you are using 192.168.0.x then all addresses must be set in the 192.168.0.x format

xjussix
03-15-2003, 05:01 PM
ifconfig:
eth0 Link encap:Ethernet HWaddr 00:A0:24:EB:31:F9
inet addr:80.223.231.121 Bcast:80.223.239.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:54 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4098 (4.0 KiB) TX bytes:799 (799.0 b)
Interrupt:5 Base address:0x220

eth1 Link encap:Ethernet HWaddr 00:20:AF:42:3C:B3
inet addr:192.168.1.1 Bcast:192.168.1.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:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:10 Base address:0x300

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:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

interfaces:
### etherconf DEBCONF AREA. DO NOT EDIT THIS AREA OR INSERT TEXT BEFORE IT.
auto lo eth0 eth1

iface lo inet loopback

iface eth0 inet dhcp
hostname breach

iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0


### END OF DEBCONF AREA. PLACE YOUR EDITS BELOW; THEY WILL BE PRESERVED.

route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
80.223.224.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
0.0.0.0 80.223.224.1 0.0.0.0 UG 0 0 0 eth0

I also checked out the sysctl.conf and had to put ip_forward=1 there.

Is the routing table ok? I haven't added there anything. 80.223.224.1 is my isp's GW.

WinXP is set to 192.168.1.2 (NOT 192.168.10.2 anymore!), GW 192.168.1.1.

bwkaz
03-15-2003, 08:41 PM
What does /sbin/mii-tool tell you? If there happens to be a problem at the link layer, mii-tool should be able to find it.

Can you ping outside the network from the XP box? (for example, try pinging Google's IP, 216.239.51.99)

What does pinging Google's IP and your own internal gateway (that is, 192.168.1.1) do from the Debian box?

xjussix
03-16-2003, 01:24 AM
Pinging the outside world from the Debian box works, but when I try to to ping the box in the lan it gets 100% packet loss.
Pinging the debian box from the Windows box doesn't work, but I haven't tried pinging the outside world from there.

I'll try the /sbin/mii-tool tool today. =)

xjussix
03-17-2003, 07:39 AM
http://www.ibiblio.org/pub/Linux/docs/HOWTO/Ethernet-HOWTO says it could be an IRQ conflict if a NIC transmits but never receives packets. How do I assign them IRQs?

xjussix
03-17-2003, 03:45 PM
Problem solved! I installed a PCI nic, which got rid of the problem immediately. :) Thanks to everyone in this thread, you have been very helpful and I appreciate it very much!