Click to See Complete Forum and Search --> : ADSL Server


soccerplayer
11-19-2003, 06:55 PM
I've searched through the forums and Ive read some basic walk throughs, but I cant seem to figure out how to set up my network. I have Gentoo 1.4 Installed on an old Emachines celeron 366 and i want to use it to be a firewall and to send any other computers at my house an internet connection. I use earthlink DSL and it is a PPPOE connection. It comes in through eth0 and i use rp-pppoe to get the connection. eth1 goes out to a hub, and from the hub, the other computers are plugged in. Like i said, i want this computer to be a firewall and send my other computers their internet connections, but I have no clue how to set anything up. I also dont know what programs to use or what exactly i need to compile into the kernel. If someone could just walk me through this like a total noob that would be best. And please dont refer me to other links or documents unless they directly and clearly can explain this because I am so lost about everything. Thanks for reading this and helping.

soccerplayer
11-20-2003, 07:37 PM
Anyone? I really could use some help

retoon
11-20-2003, 08:02 PM
Hey, you have two options, either use ipchains or iptables. I've only ever done it with IPtables. Its actually a very simple process when you think about it.
First as root user, open /etc/sysconfig/network in a text editor, and enter GATEWAYDEV=eth0. Get rid of GATEWAY=***.***.***.***.

then edit /etc/sysctl.conf and change the line net.ipv4.ip_forward=0 to
net.ipv4.ip_forward=1
then, in the terminal, as root user again, run the following commands.

#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
#iptables -A FORWARD -d 192.168.1.0/24 -j ACCEPT
#iptables -A FORWARD -s ! 192.168.1.0/24 -j DROP
#iptables-save
#/etc/init.d/network restart
#/etc/init.d/iptables restart
(where 192.168.1.0/24 is your internal network)
This is ofcourse assuming that you have iptables, which you should. Have fun, reply with updates.

jumpedintothefire
11-22-2003, 11:07 AM
PPPOE uses a ppp interface, you should change GATEWAYDEV=eth0 to GATEWAYDEV=, the rp-pppoe software should set the getway for you.

Change iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
to
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
if you want the masq to work with the above example.

To automate things you could put those commands in /etc/ppp/ip-ip.local

retoon
11-23-2003, 01:51 AM
yeah.... I completely and utterly forgot about that......... yep..............soooo..............uh huh............yeah...... maybe I'll add a little more to this so I don't feel like a complete moron, yep, ummmm...... how to sound cool, must save face, must save face......... Nope, I got nothing. Just remember at the end of all those commands, issue the

iptables-save

command. Because issuing all those commands is not something you wanna do twice. Its a pain.

soccerplayer
11-23-2003, 02:45 PM
thanks for all the help guys. Im gonna re-do the machine today and lets hope this works