LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   setup debian as a router (https://www.linuxquestions.org/questions/debian-26/setup-debian-as-a-router-743795/)

cccc 07-29-2009 07:54 PM

setup debian as a router
 
hi

I'd like to setup my Debian Lenny as a router.
Should I add in /etc/sysctl.conf
Code:

net.ipv4.ip_forward = 1
or
Code:

net.ipv4.conf.default.forwarding=1
?


my kernel:
Code:

# uname -a
Linux debian 2.6.26-2-686 #1 SMP Sun Jul 27 22:26:44 UTC 2009 i686 GNU/Linux

THX

repo 07-30-2009 02:20 AM

Take a look at
http://www.aboutdebian.com/
for some tutorials

scheidel21 07-30-2009 10:53 AM

I believe the former rather than the latter is what you want

abd_bela 07-31-2009 05:23 AM

Hi,
It is not enough if you want to access to internet and not loacl area!
If you use it as gateway to well known network, I mean you declare the gateway in both directions for subnet1 and subnet2. So the sent paquet can come back.

Otherwise, if you can't control the subnet2, if there is not gateway declared there, you need to use MASQUERADE.

here is a command to send all paquets to eth1 ( eth1 is supposed the the out card to the internet or subnet2 )

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

Hope this can help
best regards
bela


All times are GMT -5. The time now is 03:29 AM.