Networking Forums

Networking Forums > Computer Networking > Linux Networking > simple linux router, redhat 9, no nat

Reply
Thread Tools Display Modes

simple linux router, redhat 9, no nat

 
 
glenn
Guest
Posts: n/a

 
      12-23-2003, 04:44 PM
Hello,

I'm going crazy trying to make a simple router out of a redhat 9 box
with 2 nics. My goal is to use this router to basically bridge two
networks without passing DHCP. I plan to use this server/router to
supply dhcp to this test network on eth0.

main network is 192.168.168.0, 255.255.255.0

test network (behind my so called router) is 192.168.170.0,
255.255.255.0

all i want to do is sit on the test network with an ip of
192.168.170.10 and connect to hosts on the 192.168.168.0 network.

I need NO firewalling
I need NO NAT
I just want traffic to pass through this box, ha... like a router!


here is my setup


INTERNET GW 192.168.168.1, 255.255.255.0
|
|
LAN 192.168.168.0, 255.255.255.0
|
|
------------------Wanna-be ROUTER (Hedhat 9)
eth1 192.168.168.3, 255.255.255.0, gw 192.168.168.1
eth0 192.168.170.1, 255.255.255.0, gw (no idea what to use here)
--------------------
|
|
TEST LAN 192.168.170.0, 255.255.255.0
|
|
TEST HOST 192.168.170.10, 255.255.255.0, gw 192.168.170.1


from the test host i can ping 192.168.170.1 but i cannot ping
192.168.168.3 or anything on the 192.168.168.0 network.

in my /etc/sysctl.conf i have
net.ipv4.ip_forward = 1

I think it may just be that i don't have the routing tables set up
right. I have iptables installed and i flushed all the rules to make
sure iptables isn't cutting off the traffic. I have no idea if i need
iptables rules for this project. My assumption is I don not unless i
want to NAT. I don't want to nat, i just want to pass the traffic with
real ips.

Thanks!
-glenn
 
Reply With Quote
 
 
 
 
Matthew
Guest
Posts: n/a

 
      12-23-2003, 05:21 PM
well as long as eth1 has a default gateway set, and the ip address and
netmask is correct on both NICS. the router is set up
next on the 192.168.170.0 network set 192.168.170.1 as the default gateway.
next you have 2 options, you can add 192.168.168.3 as a router on your
192.168.168.0 hosts or you can add a route on yout 192.168.168.1 router
to the 192.168.170.0 network with 192.168.168.3 as the gateway. both
should work.
what is happening with your setup, is comps from your testlan have a
route to get to the LAN but the LAN has no route to your TEST lan.
adding the route to the 192.168.168.1 router is what's i'd do. but i
don't know what kind of router that is so i can't help out much onhow to
do it.
hope this helps
Matt

glenn wrote:
> Hello,
>
> I'm going crazy trying to make a simple router out of a redhat 9 box
> with 2 nics. My goal is to use this router to basically bridge two
> networks without passing DHCP. I plan to use this server/router to
> supply dhcp to this test network on eth0.
>
> main network is 192.168.168.0, 255.255.255.0
>
> test network (behind my so called router) is 192.168.170.0,
> 255.255.255.0
>
> all i want to do is sit on the test network with an ip of
> 192.168.170.10 and connect to hosts on the 192.168.168.0 network.
>
> I need NO firewalling
> I need NO NAT
> I just want traffic to pass through this box, ha... like a router!
>
>
> here is my setup
>
>
> INTERNET GW 192.168.168.1, 255.255.255.0
> |
> |
> LAN 192.168.168.0, 255.255.255.0
> |
> |
> ------------------Wanna-be ROUTER (Hedhat 9)
> eth1 192.168.168.3, 255.255.255.0, gw 192.168.168.1
> eth0 192.168.170.1, 255.255.255.0, gw (no idea what to use here)
> --------------------
> |
> |
> TEST LAN 192.168.170.0, 255.255.255.0
> |
> |
> TEST HOST 192.168.170.10, 255.255.255.0, gw 192.168.170.1
>
>
> from the test host i can ping 192.168.170.1 but i cannot ping
> 192.168.168.3 or anything on the 192.168.168.0 network.
>
> in my /etc/sysctl.conf i have
> net.ipv4.ip_forward = 1
>
> I think it may just be that i don't have the routing tables set up
> right. I have iptables installed and i flushed all the rules to make
> sure iptables isn't cutting off the traffic. I have no idea if i need
> iptables rules for this project. My assumption is I don not unless i
> want to NAT. I don't want to nat, i just want to pass the traffic with
> real ips.
>
> Thanks!
> -glenn


 
Reply With Quote
 
Leon.
Guest
Posts: n/a

 
      12-23-2003, 10:08 PM

>My goal is to use this router to basically bridge


Not bridging. You are 'routing between two networks'.

> main network is 192.168.168.0, 255.255.255.0
> test network (behind my so called router) is 192.168.170.0, 255.255.255.0
>
> all i want to do is sit on the test network with an ip of
> 192.168.170.10 and connect to hosts on the 192.168.168.0 network.
>
> I need NO firewalling
> I need NO NAT
> I just want traffic to pass through this box, ha... like a router!
>
>
> here is my setup
>
>
> INTERNET GW 192.168.168.1, 255.255.255.0
> |
> |
> LAN 192.168.168.0, 255.255.255.0
> |
> |
> ------------------Wanna-be ROUTER (Hedhat 9)
> eth1 192.168.168.3, 255.255.255.0, gw 192.168.168.1
> eth0 192.168.170.1, 255.255.255.0, gw (no idea what to use here)
> --------------------
> |
> |
> TEST LAN 192.168.170.0, 255.255.255.0
> |
> |
> TEST HOST 192.168.170.10, 255.255.255.0, gw 192.168.170.1
>
>
> from the test host i can ping 192.168.170.1 but i cannot ping
> 192.168.168.3 or anything on the 192.168.168.0 network.




>
> in my /etc/sysctl.conf i have
> net.ipv4.ip_forward = 1


Well sysctl.conf isnt magic, and if you have a typo, or got it wrong, you
have to make sure that the kernel has this set properly.



cat /proc/net/ipv4/ip_forward

if it prints 1, then its on, if it prints 0 then its off.


>
> I think it may just be that i don't have the routing tables set up
> right.


well check it . its simply three routes

a route to the network 192.168.168 on eth0
a route to the network 192.168.170 on eth1
and the default route to the internet gateway 192.168.168.1, via eth0

>I have iptables installed and i flushed all the rules to make
> sure iptables isn't cutting off the traffic.


repeat on the other boxes.



 
Reply With Quote
 
Juha Laiho
Guest
Posts: n/a

 
      12-25-2003, 10:32 AM
(E-Mail Removed) (glenn) said:
>I'm going crazy trying to make a simple router out of a redhat 9 box
>with 2 nics.

....
>main network is 192.168.168.0, 255.255.255.0
>
>test network (behind my so called router) is 192.168.170.0,
>255.255.255.0
>
>all i want to do is sit on the test network with an ip of
>192.168.170.10 and connect to hosts on the 192.168.168.0 network.


Ok.

>INTERNET GW 192.168.168.1, 255.255.255.0
> |
>LAN 192.168.168.0, 255.255.255.0
> |
>------------------Wanna-be ROUTER (Hedhat 9)
>eth1 192.168.168.3, 255.255.255.0, gw 192.168.168.1
>eth0 192.168.170.1, 255.255.255.0, gw (no idea what to use here)
>--------------------


No need for "gw" there (for eth0). A host only has one default gw.

> |
>TEST LAN 192.168.170.0, 255.255.255.0
> |
>TEST HOST 192.168.170.10, 255.255.255.0, gw 192.168.170.1
>
>from the test host i can ping 192.168.170.1 but i cannot ping
>192.168.168.3 or anything on the 192.168.168.0 network.


That you cannot ping even the "outside" interface of your router seems
rather strange -- this should be dependent only on basic routing on
the test host and on the gateway.

>I think it may just be that i don't have the routing tables set up
>right.


How is the routing set up on the test host?
How is the routing set up on the router?
How is the routing set up for machines in .168. network?

If Linux, use "netstat -rn" to display routing information.

For your router, I think there's nothing needed in addition to setting
the default gw, which you have already done.

For the machines in the .170. network, you should specify the default
gateway as .170.1 .

For the machines in the .168. network, you should specify the default
gateway as .168.1 . Additionally, either the router at .168.1 should
know about your .170. network located behind .168.3, or alternatively
the mahcines within .168. network should each have a static route set
up for the .170. network, to be routed using the .168.3 as the gateway
for that.

>I have iptables installed and i flushed all the rules to make
>sure iptables isn't cutting off the traffic. I have no idea if i need
>iptables rules for this project. My assumption is I don not unless i
>want to NAT. I don't want to nat, i just want to pass the traffic with
>real ips.


No need for iptables when you're only routing (as in this case).
Check tough that you have set the iptables chain policies to
ACCEPT, in addition to removing all the rules.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
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
Redhat Linux 8 and Redhat Enterprise Linux 4 printer not configure Niraj Linux Networking 0 12-06-2006 04:51 AM
How to create RedHat Linux machine as router chonja@inbox.lv Linux Networking 1 04-21-2005 02:31 PM
Red Hot Linux v9.0 [2 DVDs]. Red Hot Linux v9.0 [3 CDs]. Redhat Enterprise Linux ES v3.0 REPACK [4 CDs]. Mandrake Linux 9.2 [3 CDs] - new ! TEL Linux Networking 0 11-29-2003 11:27 AM
Simple Routing with Redhat 9 Jimbo Johnes Linux Networking 2 11-14-2003 09:19 PM
redhat as 2.1 SIMPLE networking questions Equis Uno Linux Networking 2 09-04-2003 02:04 AM



1 2 3 4 5 6 7 8 9 10 11