Results 1 to 3 of 3
Thread: Connection Sharing
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Feb 2009
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -i ath0 -o ppp0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ppp0 -o ath0 -j ACCEPT
echo "1" > /proc/sys/net/ipv4/ip_forward
But I still cant ping PC2 from PC3. Can anyone point me in the right direction? I have been googleing for 2 days with no luck. Thanks in advance for any help.
I'll start by telling you I'm no expert at this (in fact I usually steer well clear of ip tables).
My understanding of the IP stack implementation, however, is that it shouldn't matter what the underlying hardware is - that's the whole point of using the OSI 7-layer model for networks. Provided you have known IP addresses, you should be able to establish routes based on that.
What I think you have to do is repeat your configuration statments, but use IP addresses rather than device names wherever you can.Linux user #126863 - see http://linuxcounter.net/
No need to steer clear of iptables. It isn't that hard once you have the basics.
First off IPTABLES does no routing! It just allows/blocks traffic at the interface.
This is how I see you setup now, please correct anything that is wrong.
Device Int IP
------ ---- ----------------
PC1 ath0 192.168.1.1
PC1 ppp0 ?
PC2 ppp0 192.168.1.200
PC3 ath0 192.168.1.3
If you are looking to just pass traffic from PC3 to PC2 and PC2 to PC3 your really don't need iptables. As stated above it does not route. By turning on forwarding, as you did, traffic should pass. If you have no reason for a firewall I would suggest you turn it off.
Now to the problem at hand. Looking at the above there is an IP address missing from PC1 on the pp0 interface. Every interface needs an ip address for routing.
On each machine can you provide the output from the following commands:
ifconfig route -na
The adventure of a life time.
Linux User #296285