On Sat, 2003-04-12 at 15:32, Adrian Madrid wrote:
> Any ideas? I've been thinking about ditching the connection sharing
> thing (drakgw) and getting either a nice iptables tutorial or a
> package (with a gui if possible) that would do the trick nicely. Any
> recomendations?
I too was scared of a non-graphical NAT solutoin for quite some time,
but it really only takes a few lines to run a NAT box with 2 network
cards. Here are those lines (just replace eth0 and eth1 to match you
setup)
#!/bin/bash
# The interface that plugs into the internet
OUT_INTERFACE=eth0
# The network card that plugs into your local network
IN_INTERFACE=eth1
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --table nat --append POSTROUTING --out-interface $OUT_INTERFACE
-j MASQUERADE
iptables --append FORWARD --in-interface $IN_INTERFACE -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
There you have it. And now, a simple /etc/dhcpd.conf:
allow unknown-clients;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.2.1;
default-lease-time 172800;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 198.60.22.2, 198.60.22.22;
option domain-name "example.com";
}
So, just run "/etc/init.d/dhcpd restart" and run that iptables script,
and you are ready to share connections and hand out DHCP. Works for me
like a charm.
--Dave
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list