>>>I have three windows boxes(98,XP,XP) each with a configured network card
>>>and one linux box (Mandrake 8.1)with 3 network cards all configured and
>>>working properly.
>>> ----------------
>>>Win1 192.168.0.10 -----------|192.168.0.1
>>>Win2 192.168.1.10 -----------|192.168.1.1 linux box
>>>Win3 192.168.2.10 -----------|192.168.2.1
>>> ----------------
>> If you really really want to do
>> it with the physical connections you've got now, type this command in
>> Linux:
>> echo "1" > /proc/sys/net/ipv4/ip_forward
> IP forwarding is on, and the default gateway for the windows boxes is
> the linux box, but I still can't ping from one windows box to another.
I suspect that you're mistaken about one of those two things. In Linux,
try typing the following command and report back the results:
cat /proc/sys/net/ipv4/ip_forward
If IP forwarding is enabled, the result will be "1"; if not, it'll be "0".
It's also possible that you've got packet-filter firewall rules set up to
block packets from being routed. Try typing this command to check:
iptables -L
You'll have to be root to use that one. You should see output like this:
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
If any of the policies (especially FORWARD or OUTPUT) is not ACCEPT, then
the system may be dropping forwarded packets. Likewise if there are a
bunch of rules listed under these policies. If this is the case you'll
need to track down your firewall script and modify it.
Quote:> Is there anywhere on the linux system that logs are kept, so that I
> might be able to see where the failure is when I try to ping through the
> box.
Linux doesn't normally log every packet it receives, although it can be
configured to do so with the help of various tools (iptables, Snort,
etc.). That said, most Linux log files are in /var/log or its
subdirectories. Chances are they won't help you much in this case, but you
can certainly check them. Try using the "tail" command to view the last
few lines of a log file after performing an action that should produce
logging.
Quote:> Just to help my understanding, I want to explain what it is I think I am
> doing, and then maybe somone could correct me.
> Win1 (192.168.0.10) ----------------
> GateW(192.168.0.1) -----------|192.168.0.1
> |
> Win2 (192.168.1.10) |
> GateW(192.168.1.1) -----------|192.168.1.1 linux box
> |
> Win3 (192.168.2.10) |
> GateW(192.168.2.1) -----------|192.168.2.1
> ----------------
> All Subnet masks 255.255.255.0
> Say Win1 wants to talk to the linux box, it knows its on the same
> network, so it just send IP packets with to (192.168.0.1)
> If Win1 wants to talk to Win2, its not on the same network, so it looks
> up the default gateway which is the linux box on (192.168.0.1), and then
> sends out the IP packets with headers (192.168.1.10) to (192.168.0.1),
> the linux box recieves these, and then knows that they are not for it,
> but are to be forwarded to (192.169.1.10), so it sends them out from
> (192.168.1.1) to Win2.
That's the way it should work, yes.
Quote:> What should the linux box think the default gateway is (Ie it is the
> default gateway???)
Given the information you've presented, it shouldn't have one. If it's got
another network connection, though (say, to a DSL connection or even a PPP
dialup link), the default gateway would be to it.
Quote:> If I ping an internet address from Win1 eg google (216.239.33.101)
> whilst I have a dial up connection established on Win1, how does that
> box know not to use the Gateway on the Lan (192.168.0.1) but use the
> gateway at the end of the modem instead?
You didn't say anything about dial-up connections. They're a potential
monkey wrench, particularly on the Windows boxes. I don't know offhand
what Windows does when you establish a dial-up connection. It might
replace the default route, in which case it'd break your connection to
other systems on your LAN, with the possible exception of the Linux box.
In theory, another way to configure it is to make the dial-up
connection's router the default route and to make your Linux box the
route only for the 192.168.x.x addresses. I don't know offhand how you'd
configure Windows to do this.
If the Linux box has an Internet connection, this is much simpler -- but
there is another complication. To let the Windows boxes have access to the
Internet via the Linux gateway, you'd need to enable network address
translation (NAT). You should be able to do this by typing the following
command once the connection is up:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
This assumes that it's a PPP connection and that you've only got one PPP
connection. You may also need to load a module by typing "modprobe
iptable_nat" (without the quotes) before typing the above command. Also,
I've never tried to do QUITE this thing, so there may be some factor I'm
overlooking or forgetting.
--
http://www.rodsbooks.com
Author of books on Linux, networking, & multi-OS configuration