this post is rated pg 13 for some language content.
this gets asked so much, you could do a search on "internet connection sharing" and get maybe 1000 good results....so this will make 1001
please note this is not secure enough, im just gonna give u the rules
for getting the connection shared. if u want firewall rules (which you DO want)
i suggest doing a serch on this forum on the work "firewall", there are plenty
of good examples (some by me

but i think markus has the best one i've seen ) if you do a search on "nailed down markus" i bet you'll find the thread.
1.make sure both computers have NICs (network cards)
2.connect the two computers with a crossover cable (that is important)
network setup:
on box connected to the internet:
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 bcast 192.168.0.255
on other box:
ifconfig eth0 192.168.0.2 netmask 255.255.255.0 bcast 192.168.0.255
you will also have to add the name servers to resolv.conf
here is m y resolv.conf file for an example:
Code:
nameserver 205.152.37.254
nameserver 205.152.144.235
domain bellsouth.net
you may have to do some route add stuff but we'll get to that later i guess.
another way to do all this is open up the network configuation GUIS and put
in the info in the text fields:
computer 1(internet gateway): eth0
ip. 192.168.0.1
mask. 255.255.255.0
gateway/router: 192.168.0.1 (itself)
copmuter 2: eth0
192.168.0.2
mask 255.255.255.0
gateway/router 192.168.0.1 (the above)
if you do it that way using the GUI stuff, the routing tables get set for you and everything.
after you get all taht setup, go to console and type :
eth0 down
eth0 up
on both machines.
iptables rules:
this goes in file...some people put it in rc.firewall, so u can do the same...
#### variables section #####
EXTIF="ppp0"
LANIF="eth0"
CLIENT_IP="192.168.0.2"
SERVER_IP="192.168.0.1"
echo "1" > /proc/sys/net/ipv4/ip_forward ### turns on ip forwarding
### ALLOW EVERYTHING, MAKE THIS ROUTER A BITCH ###
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
###### THIS IS SOO NOT SECURE for POLICY #############
### MASQUERADEing
iptables -A POSTROUTING -t nat -s $CLIENT_IP -j MASQUERADE
######################## EXTRA JUNK BELOW THIS LINE ####################
that might be the only rule you need just to share the internet but again i say THIS IS BY NO MEANS A SECURE SETUP, YOUR MACHINE IS BUCKET NAKED. But you wanted teh quick and dirty.....that's as quick and dirty as i can get without leaving out 2 much info. I left out firewall stuff but i'd go with something more like:
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
### now you have a virgin....nothing in nothing out nothing gettin through
### now lets open her up....
iptables -A OUTPUT -m state --state ! INVALID -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED, RELATED
### now we can browse the web!!! whoo whoo!!!!
then u'd have to do some FORWARD rules and if you wanted certain ports open u'd have to add that stuff....but you didnt ask for all that so i'll quit here.
i hope this helps man.