Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 07-29-2009, 08:54 PM   #1
Senior Member
Registered: Sep 2003
Distribution: Debian Squeeze / Wheezy
Posts: 1,623

Rep: Reputation: 50
setup debian as a router


I'd like to setup my Debian Lenny as a router.
Should I add in /etc/sysctl.conf
net.ipv4.ip_forward = 1

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

Last edited by cccc; 07-29-2009 at 08:59 PM.
Old 07-30-2009, 03:20 AM   #2
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look at
for some tutorials
Old 07-30-2009, 11:53 AM   #3
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,315

Rep: Reputation: 99
I believe the former rather than the latter is what you want
Old 07-31-2009, 06:23 AM   #4
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 622

Rep: Reputation: 31
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple Debian Router Setup th_dan Linux - Networking 5 08-26-2007 07:43 PM
LXer: The Perfect Setup - Debian Etch (Debian 4.0) LXer Syndicated Linux News 0 04-10-2007 02:16 PM
router setup MACSRULE General 3 09-01-2005 11:02 PM
Debian Iptables Router Setup RussellPreece Linux - Networking 14 04-13-2005 07:26 AM
ADSL Routers Setup- Microsom Deskporte router 100 and Planet ADSL modem router mabonline Linux - Hardware 1 02-27-2004 06:36 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration