Grant (remove spam.bad.) wrote:
> I have looked at lots of how to's and I think I am very close to
getting my
> linux box to actually route traffic. This is what I have..
>
> Redhat 9
> I have DHCP working (can get an address on my WinXP laptop)
> I have dnsmasq for DNS server/caching and it seems to work
>
> I need to get NAT working, so I have tried the following w/iptables..
> iptables --flush
> iptables --table nat --flush
> iptables --delete-chain
> iptables --table nat --delete-chain
> iptables --table nat --append POSTROUTING --out-interface eth0 -j
MASQUERADE
> iptables --append FORWARD --in-interface eth1 -j ACCEPT
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> I have two eth cards and eth0 is connected to my router and I have
Internet
> access on the Linux box. Eth1 authmatically assigns IPs to my XP
laptop.
> DNS seems to work as when I try to connect to www.google.ca I can see
that
> it resolves the name. Problem is I can't actually access or ping the
> Internet from my laptop.
>
> Can anyone help? Do I need to do a route command?
On Linux/RH9 command line/terminal:
$ route -n
$ ifconfig -a
On XP command line run:
[prompt] ipconfig /all
Linux needs static net/host route to XP interface/IP (eth1)
$ man route
XP needs the Linux box interface IP as its default route/GW
[prompt] ??? can't remember just now which gui tool/dialog
XP:
ping localhost
ping RH9 eth1 IP
ping RH9 by name
ping dns server IP (local?)
ping RH9's ISP gateway directly
ping ISP's dns server directly
If all is OK, enjoy.
If not, remove firewall on RH9 _and_ XP temporarily (and disconnect
from ISP till you're ready to ping that connection). You must confirm
IP connectivity before futzing with the RH9/XP firewalls.
Once you establish connectivity, put XP's firewall in place -- note
that the SP2 update just out finally provides XP with an "acceptable"
host firewall. Use it! Or use ZoneAlarm.
Haven't bothered to look at your iptables rules -- no use till you
confirm connectivity.
All we need really is the output of:
[root]# iptables -L -v
Offhand, the script above, if that's all there is to it, looks shakey.
hth,
prg
email above disabled