LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-05-2006, 03:29 PM   #1
atuk1
LQ Newbie
 
Registered: Feb 2006
Posts: 1

Rep: Reputation: 0
Smile linux router setup... use iptables???


Hi all,

Wonder if somebody can help me out a little here.
I'm trying to simulate two machines sitting on two different C class networks - being connected by a router (which in this case i want to be a linux router).

I want to be able to ping either network from each other.

so for eg

clientA: 192.168.1.100/24 eth0

clientB: 192.168.2.100/24 eth0

serverA: 192.168.1.1/24 eth0
192.168.2.1/24 eth1

I've read around enough to know the answer lies in a iptables file/ setting - but i think i'm gonna have to get a good book on the iptables subject ...

Any help would be most appreciated.

thanks in advance - at.
 
Old 02-05-2006, 04:11 PM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Well I believe IPTables is probably definitely what you would like to use in this case. There are two books that I know of out there.

Linux Firewalls - It is mainly geared towards firewalls but has a lot of information on IPTables as far as setting up multiple Class C networks behind one router.
Linux Routers - I have no read this so I really can't comment on it, but it has gotten good reviews from Amazon.

I hope this helps
 
Old 02-05-2006, 04:15 PM   #3
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
1. google for 'iptables tutorial' will give you a very good book

2. clients: need a default route added to their routing table
route add default gw <gateway address> dev eth0

3. router: needs to have forwarding enabled:
echo 1 > /proc/sys/net/ipv4/ip_forward

if this still should not work, make sure iptables is not blocking any traffic at all (in none of the tables)
setting the policies to ACCEPT and Flushing all the tables will do the job, though i think you should be fine.
i gues you are not trying to setup NAT so the obove mentioned things sould be enough. once you get that part running, you can close down ports with iptables aso.
little hint: usually you set a router to be the hightes of you ip range (192.168.1.254)

hope this helps
 
  


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
Linux as router, iptables and eMule thugic Linux - Networking 2 01-12-2006 06:03 AM
Debian Iptables Router Setup RussellPreece Linux - Networking 14 04-13-2005 06:26 AM
Linux router IPTABLES Howto hakcenter Linux - Networking 1 07-14-2003 09:03 PM
Linux Router, setup???? francisjk Linux - Networking 4 08-08-2002 06:59 PM
Trying to setup a firewall router using iptables pmoss Linux - Networking 3 03-20-2002 12:15 AM

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

All times are GMT -5. The time now is 05:57 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