Code Sample |
links damnsmalllinux.org |
Code Sample |
/ HowTos |
Code Sample |
/ NAT |
Code Sample |
<esc> <f> <d> |
Code Sample |
vi natconfig.sh |
Code Sample |
d1G |
Code Sample |
dG |
Code Sample |
?EOF ddOEOF<esc> |
Code Sample |
55<j |
Code Sample |
:wq |
Code Sample |
. ./natconfig.sh |
Code Sample |
# download ibiblio /pub/Linux/distributions/damnsmall/mydsl/system/iptables.dsl wget http://ibiblio.org/pub/Linux/distributions/damnsmall/mydsl/system/iptables.dsl # install iptables mydsl-load iptables.dsl # configure subnet for eth1 ifconfig eth1 192.168.2.1 netmask 255.255.255.0 # clear iptables info? # iptables --flush # iptables --table nat --flush # iptables --delete-chain # iptables --table nat --delete-chain # create NAT rule iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE # I didn't need this line. but maybe you do? # (in case you have deny rules somewhere?) # iptables --append FORWARD --in-interface eth1 -j ACCEPT # turn on routing echo 1 > /proc/sys/net/ipv4/ip_forward # ??? /etc/init.d/dhcpd3-server start doesn't work! # (I guess I was supposed to know to use "apt-get install" on dhcp3-server) # get apt-get working dpkg-restore # Do I need to run this too? Maybe not. # apt-get update # install the dhcp server (why do I need to uninstall dhcp3-common?) apt-get remove dhcp3-common apt-get install dhcp3-server cd /etc/dhcp3 mv dhcpd.conf dhcpd.conf.dsl cat dhcpd.conf.dsl /etc/resolv.conf >> dhcpd.conf cat >> dhcpd.conf << EOF # Comment out the search and nameserver entries. # Copy their values into the domain-name and domain-name-servers entries subnet 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.100 192.168.2.200; option routers 192.168.2.1; } EOF # vi dhcpd.conf # type /etc/init.d/dhcpd3-server start # the dhcp server should start |