View previous topic :: View next topic |
Author |
Message |
groovin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/StarCraft/starcraft_terran_ghost.gif)
Joined: 07 Feb 2004 Posts: 429 Location: California, USA
|
Posted: Thu Apr 08, 2004 10:43 pm Post subject: Gentoo router - iptables? |
|
|
i need to setup a gentoo box to act as a router between two private subnets:
192.168.0.0/24---Gentoo box---192.168.1.0/24
every search on linux routing I do brings up iptables.
Is iptables a requirement to run a router? Are there any other requirements (emerge --pretend iptables shows not depends)?
thanks |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pathose Retired Dev
![Retired Dev Retired Dev](/images/ranks/rank-retired.gif)
![](images/avatars/1980343783fce3e9003685.jpg)
Joined: 08 Nov 2003 Posts: 35 Location: Ohio, USA
|
Posted: Thu Apr 08, 2004 10:49 pm Post subject: |
|
|
iptables are something you compile into your kernel. I'm not sure about what else needs to be emerged, you'll have to dig through the portage tree and get back to us . Once you have iptables compiled either into your kernel or as a module, you need to write a routing/firewall script. I'd recomend looking into fireHOL; i haven't set this up yet, but this looks like the tool to use. # emerge firehol should do the trick, i'd imagine. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
kpack Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 29 Mar 2004 Posts: 137
|
Posted: Thu Apr 08, 2004 10:55 pm Post subject: |
|
|
IPTABLES has nothing to do with setting up routing.
Do the following:
Make sure routing is configured into your kernel.
Then, enable it:
echo "1" > /proc/sys/net/ipv4/ip_forward
Then read the following documentation:
man route or
man ip
The first one uses the classic route command, the second uses Alexey Kuznetsov's iproute2 tools.
I'm not which Gentoo config file is the right place to store these commands, once you work them out from the command line. Maybe another use knows. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
groovin Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/StarCraft/starcraft_terran_ghost.gif)
Joined: 07 Feb 2004 Posts: 429 Location: California, USA
|
Posted: Thu Apr 08, 2004 11:36 pm Post subject: |
|
|
just got it.
I edited /etc/sysctl.conf and changed
net.ipv4.ip_forward = 0
to
net.ipv4.ip_forward = 1
then i enabled it with
# sysctl net.ipv4.ip_forward=1
and it works. Pretty much the equiv of what you posted kpack.
thanks again for the help everyone! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|