LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2006, 04:59 PM   #1
crashsystems
Member
 
Registered: May 2006
Location: Tennessee et. al
Distribution: Debian Sid, Etch
Posts: 138

Rep: Reputation: Disabled
Debian 3 NIC static routing table


I have a Debian box I want to turn into a gateway for my office network with NICs being eth0 (Internet, 68.37.2.55, subnet 255.255.255.224) eth1 (office, 192.168.0.1/16) and eth2 (wifi, 192.168.1.1/16). I've been doing a lot of research recently to learn everything necessary to get this setup working, but there is one thing that still has me a bit confused. I want to set a static routing table that will allow outbound traffic from eth1 and eth2 to reach the web, but I don't want traffic to be able to travel from eth2 to eth1 or vise-versa (in other words, I want them to be completely separate networks). I already know what iptables rules I plan on using, I'm just not sure how to set up the routing table. If anyone could give me some advice, that would be great.


crashsystems
 
Old 11-08-2006, 03:30 AM   #2
Samotnik
Member
 
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471

Rep: Reputation: 40
Routing table can't help you, becouse routing doesn't deal with source address and source interface. Only iptables do this job.
Then your ethernet and wi-fi should have a /24 masks, becouse /16 mask describes subnet with two floating bytes (192.168. ). 192.168.0.1/16 and 192.168.1.1/16 are the one subnet.
All packets to Internet must be routed with default address setting, becouse they all have different addresses.

Than you need make a routing:
route add 192.168.0.0/24 dev eth1
route add 192.168.1.0/24 dev eth2
route add default dev eth0

And iptables settings:
iptables -A FORWARD -i eth1 -o eth2 -j REJECT
iptables -A FORWARD -i eth2 -o eth1 -j REJECT
 
Old 11-08-2006, 10:01 AM   #3
crashsystems
Member
 
Registered: May 2006
Location: Tennessee et. al
Distribution: Debian Sid, Etch
Posts: 138

Original Poster
Rep: Reputation: Disabled
Thanks for your help, that clarifies a lot for me. I have a quick question about those two iptables lines. Are they designed to make sure that traffic from wireless can't go into the office, and vise-versa, and if so, would it be better to drop the packets instead of reject?

crashsystems
 
Old 11-09-2006, 12:58 AM   #4
Samotnik
Member
 
Registered: Jun 2006
Location: Belarus
Distribution: Debian GNU/Linux testing/unstable
Posts: 471

Rep: Reputation: 40
When you REJECT packet firewall sends an ICMP packet to sender. On outer network this can give a usefull information to a hacker scanning your network, that's why it's not used. But in inner network it will prevent some applications from generating a "junk" traffic.
 
  


Reply



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
changing routing table in Debian sarge linian Linux - Networking 2 07-26-2006 12:14 AM
routing table arvind kumar Linux - Networking 2 06-08-2005 11:59 PM
Help with a Routing Table maginotjr Linux - Networking 4 06-06-2005 09:49 AM
No Routing table in debian tbartolucci Linux - Networking 2 06-18-2004 10:20 AM
routing table upr8830 Linux - Networking 6 06-18-2003 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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