On Mon, Sep 22, 2003 at 09:43:37AM +0900, Jason Stubbs wrote: > > I want to setup a DHCP server on my desktop machine so that I can plug > > my laptop into my second network port and then access the internet > > through my desktop using NAT. However I can't get it too work. I've > > followed as much of the NAT and DHCP howtos that I can but can't get it > > too work. > > > > Does anyone know of an idiots guide to setting this up? > > The only guide I know of is http://www.netfilter.org/documentation/HOWTO/ > NAT-HOWTO.html > > It should be fairly straight forward to set up though. Try the following: > > If you are using dhcp to get your ip address for your internet connection on > eth0 and eth1 is your "local network" connection, you can set up dhcpd to > give out ip addresses in the 192.168.1.0/24 range and use the following to > enable natting: > > iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j MASQUERADE > echo 1 > /proc/sys/net/ipv4/ip_forward > > If you have a static ip address for the internet that is 1.2.3.4 for example, > the following should work: > > iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j SNAT --to-source > 1.2.3.4 > echo 1 > /proc/sys/net/ipv4/ip_forward > > If the above doesn't work, indicate how you have it set up so far and we can > go from there.
Well I've followed the NAT HOWTO and I still can't get it working. I have managed to get a DHCP server running, it gives an IP address out in the range 10.0.0.0 to 10.0.0.100 - this works. I've attached my firewall script, one thing I've noticed is that firewall status doesn't say anything regarding NAT when looking at the script it should? skymoo root # /etc/init.d/firewall status * status: started skymoo root # Also iptables -L shows nothing regarding NAT skymoo root # iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:ssh LOG all -- anywhere anywhere LOG level warning prefix `FIREWALL:INPUT ' Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere skymoo root # Any pointers would be appreciated. Cheers Adam -- [EMAIL PROTECTED] mailing list
