I am trying to get
NAT set up for use with my Zaurus (PDA). The basic layout of my network
is:
cable modem ->
linux firewall (with NAT, works fine) -> desktop ->
Zaurus
The Zaurus is
connected to the desktop through USB. The usbdnet modules allows network
access to the Zaurus from my desktop. The Zaurus has the IP address
192.168.129.201, and my desktop has the IP address 192.168.129.200 on the usb0
interface, and 192.168.1.2 on the eth0 interface. Without nat I can ping,
ssh, etc. to the Zaurus with no problem, for long periods of time. The
usb0 interface on my desktop is set up by:
ifconfig usb0 192.168.129.200 netmask 255.255.255.255 up
route add -host 192.168.129.201 usb0
So, I have network
access to/from the Zaurus at this point, but no internet access. So at
this point I want to set up NAT on my desktop, so it can take care of
interfacing the Zaurus to the internet. So on the desktop I add the
following rules:
iptables -F
iptables -t nat -F
iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to-source 192.168.1.2
This works fine at first, but after less than a minute I can no longer get to the Zaurus from my desktop. If I rmmod the iptables modules, I can then see it again.
I am running kernel 2.4.20 on Gentoo. I am using the default gcc that it comes with (3.2.2 I believe).
/proc/sys/net/ipv4/ip_forward is set to 1
/proc/sys/net/ipv4/ip_conntrack_max is 32760
I'm not really sure
what other information is relevant here. I did see an almost identical problem
when I was setting up the linux firewall mentioned above. There, it was just a
low-end box with 2 ethernet cards, with the cable modem on one and my hub on the
other. I got NAT set up with kernel 2.4.8 (I think) and it would work fine
for a few minutes. After that, though, I could not communicate from
my desktop to the firewall or internet. So, it is pretty much the
identical problem, but with usb0 now instead of eth1 for the end computer.
That time was with a vanilla kernel compiled with gcc
2.95.3.
Any ideas on what I'm doing
wrong here?
Jon