> 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.

Jason

--
[EMAIL PROTECTED] mailing list

Reply via email to