bburns35
Group: Members
Posts: 2
Joined: April 2005 |
|
Posted: April 24 2005,20:42 |
|
How to: get the previous post as a text file.
Code Sample | links damnsmalllinux.org |
Select Forums (w/ right-cursor)
Search for HowTos by typing:
Select HowTos (w/ right-cursor)
Search for NAT by typing:
Select "Be a NAT Router (like linksys)"
type keys: Code Sample | <esc> <f> <d> |
When prompted w "Save as file" enter "natconfig.sh" Hit <q> key.
Now that you've downdoaded this file, you'll have to clean it up w/ your favorite editor (vi)
Type: Code Sample | vi natconfig.sh |
and waitaminute. It's all indented, and the URL got munged. How do I fix this?
Oh. I'll re-post inside "code" markups no... that's still indented...
Ok, so edit this file... go to the line above the (2nd copy of the) code and type:
That should delete everything up to the top of the file.
Now go to the line below the code and type:
That should delete the rest of the cruft.
Now eliminate mysterious trailing blanks by typing: (note <esc> referrs to the "escape" key)
Code Sample | ?EOF ddOEOF<esc> |
Now unindent by going back to the first line in the file, and typing:
repeat this step until the code is flush to the left.
now exit vi by typing
Now cross your fingers And run the script by typing
Code Sample | . ./natconfig.sh |
Things should download. apt-get will spew errors 'cause it can't write to your CD + stuff... apt will also ask you where your dhcp server should listen. (eth1)
If you're lucky you can ignore all the errors and it'll all just work.
Don't forget to tailor the dhcpd.conf file for your network And to run the /etc/init.d/dhcpd3-server script.
Here's the re-posted code. -------------------------------------------------------------------
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
|
This should work on machines w/ at least 64 megs of ram. For some reason, 32 megs won't cut it. (scheesh)
Good luck.
|