Networking Forums

Networking Forums > Computer Networking > Linux Networking > routing between subnets

Reply
Thread Tools Display Modes

routing between subnets

 
 
Indrek M.
Guest
Posts: n/a

 
      07-31-2003, 11:56 AM
I have NAT router (R.H7.3) with 2 subnets (eth1 and eth2), eth0 go to
internet.
From both subnet can go to internet.
But I want go from one subnet to second.
How can tat do? IPTABLES default policys are all ACCEPT and NAT work
well.


| internet
| eth0
|
|
|
-----------
| Router |
| |
-----------
| |
| |
| eth2
| 192.168.11.1/24
eth1
192.168.10.1/24
 
Reply With Quote
 
 
 
 
Peter Roiler
Guest
Posts: n/a

 
      07-31-2003, 03:04 PM
> But I want go from one subnet to second.
> How can tat do? IPTABLES default policys are all ACCEPT and NAT work
> well.
>
>
> | internet
> | eth0
> |
> |
> |
> -----------
> | Router |
> | |
> -----------
> | |
> | |
> | eth2
> | 192.168.11.1/24
> eth1
> 192.168.10.1/24

I think you won't need NAT for traffic between the two local subnets.
First you have to configure the router, to forward the Packages, what
you did. Now you only need to have working routes both at the clients
and the router. Looks like this:
Client:
route add -net 192.168.11.0/24 gw router
at the first subnet
route add -net 192.168.10.0/24 gw router
at the second
Router:
route add -net 192.168.10.0/24 dev eth1
route add -net 192.168.11.0/24 dev eth2
That should do.

bye
Peter

 
Reply With Quote
 
David Efflandt
Guest
Posts: n/a

 
      07-31-2003, 06:42 PM
On Thu, 31 Jul 2003 14:56:53 +0300, Indrek M. <(E-Mail Removed)> wrote:
> I have NAT router (R.H7.3) with 2 subnets (eth1 and eth2), eth0 go to
> internet.
> From both subnet can go to internet.
> But I want go from one subnet to second.
> How can tat do? IPTABLES default policys are all ACCEPT and NAT work
> well.
>
>
> | internet
> | eth0
> |
> |
> |
> -----------
> | Router |
> | |
> -----------
> | |
> | |
> | eth2
> | 192.168.11.1/24
> eth1
> 192.168.10.1/24


You need to insert rules at the head of your iptables FORWARD chain that
forwards between these interfaces, before it hits any masq rules. Not
sure if exact syntax is correct since this is based on an old ipchains
example I had, but something like this:

iptables -I FORWARD -p all -s -i eth1 -d -i eth2 -j ACCEPT
iptables -I FORWARD -p all -s -i eth2 -d -i eth1 -j ACCEPT

Or maybe this could be condensed to:

iptables -I FORWARD -p all -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT

--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing problem with 2 subnets Todd Spear Windows Networking 1 05-04-2006 03:33 PM
routing two subnets billbo Linux Networking 2 02-08-2006 12:39 AM
DHCP and routing across subnets Eric Nutt Windows Networking 2 07-04-2005 06:59 PM
routing two private subnets? William Gill Linux Networking 5 01-28-2005 01:20 PM
Routing with 2 Subnets on one NIC Rusty Phillips Linux Networking 4 12-15-2003 08:36 PM



1 2 3 4 5 6 7 8 9 10 11