# [Gentoo Internet Router] Basic configuration help

## emilio_wuerges

Hello, 

During all my life I only had 1 valid IP address and used the Gentoo Home Router guide to set up my network.

But now I'm in a situation that I have a range of ips xxx.xxx.60.240/255.255.255.192.

So I'm lost. I don't even know how to start.

I want to setup my network so 1 machine will serve as a firewall and DHCP servers.

What should I do? Do you know where I find a nice guide to do it?

----------

## d2_racing

Ok, if I understand, you will have a box in front of your lan, and all your box with pass thrue that box.

If so, you will need to use the forward command, so that the trafic can pass from the net, thrue the firewall and end up on your box.

And the same goes for the other direction.

----------

## emilio_wuerges

Hi. 

Thanks for the quick reply.

My network setup will be quite simple:

(Internet) -- eth0 -- (linux firewall) -- eth1 -- switch -- (my boxes).

So the configuration you suggest is something like:

iptables -A FORWARD -i eth0 -d *.60.240/26 -j ACCEPT 

iptables -A FORWARD -i eth1 -d -j ACCEPT 

But what about routing? 

What dhcp server should I setup?

----------

## d2_racing

 *emilio_wuerges wrote:*   

> But what about routing? 

 

It will depends, because you will at least open port from your firewall to your lan and for routing, you will need to ajust your box so that the default gateway will be for example 192.168.1.1 and that will be the IP adress of your firewall, or the first ip adress that will be available from your range of ip.

And for the dhcp, I don't know, but make sure that your firewall runs a dhcp server, because your router will be not be able to do his normal job.

----------

## shazeal

http://wiki.archlinux.org/index.php/Simple_stateful_firewall_HOWTO

I used this setting mine up. Just used dnsmasq for DNS/DHCP.

----------

## d2_racing

That's a nice wiki indeed  :Razz: 

----------

## d2_racing

I wrote that a wild ago.

You can compare the 2 scripts : http://www.gentoo-quebec.org/wiki/index.php/Utilisation_de_Iptables_pour_d%C3%A9butant

----------

