RH8 routing

RH8 routing

Post by Werner vd Merw » Fri, 16 May 2003 18:02:36



Morning,

A bit of a green question, but I have a RH8 box running purely as a router,
the layout has just been added another dimention, which leaves me a bit
dazed and confused :)

How can I add a route to a specific interface?

The router has 2 network cards.
eth0 192.168.21.253
eth1 192.168.10.253

192.168.0.253 is a Mitel SME server (192.168.10.254/192.168.11.10), acting
as gateway to 192.168.11.0
IMHO, I need to add a route on eth0, 192.168.11.253 nm 255.255.255.0 gw
192.168.10.254 ?

Any help will be appreciated.

Thx

 
 
 

RH8 routing

Post by Tomislav Sajd » Fri, 16 May 2003 23:17:37



> Morning,

> A bit of a green question, but I have a RH8 box running purely as a
> router, the layout has just been added another dimention, which leaves me
> a bit dazed and confused :)

> How can I add a route to a specific interface?

> The router has 2 network cards.
> eth0 192.168.21.253
> eth1 192.168.10.253

> 192.168.0.253 is a Mitel SME server (192.168.10.254/192.168.11.10), acting
> as gateway to 192.168.11.0
> IMHO, I need to add a route on eth0, 192.168.11.253 nm 255.255.255.0 gw
> 192.168.10.254 ?

I am not quite sure what you want to do, but if you want to force some
interface, it is done using dev:

route add -net x.y.z.t netmask 255.255.255.0 gw a.b.c.d dev eth1

replacing 255.255.255.0 with appropriate mask, and eth1 with apropriate
interface.

But it is rarely necessary to explain which interface should be used.

If you have smth like this:

                             192.168.21.1     192.168.44.1
--------------[box A]-------------------[box B]--------------[box C]-----
           eth0     eth1                                           other
 192.168.21.253     192.168.21.253                                 nets
                                                                   here

you should say
route add -net 192.168.44.0 netmask 255.255.255.0 gw 192.168.21.1

now you could use some host at .44.0 network as a gw (gateway) to
some other network

- Show quoted text -

Quote:

> Any help will be appreciated.

> Thx


 
 
 

RH8 routing

Post by Werner vd Merw » Sat, 17 May 2003 23:29:18


Thanks for the reply, can I just create the /etc/sysconfig/static-routes
file if it does not exsist? Can I just add routes with "route add -net
x.y.z.t netmask 255.255.255.0 gw a.b.c.d dev eth1" within the file? Mitel
uses "eth0 -net xxxx.netmask y.y.y.y gw z.z.z.z", must I use the first one?

Last one quick, how can I activate the routes without bouncing the box?

Appreciate your help.




> > Morning,

> > A bit of a green question, but I have a RH8 box running purely as a
> > router, the layout has just been added another dimention, which leaves
me
> > a bit dazed and confused :)

> > How can I add a route to a specific interface?

> > The router has 2 network cards.
> > eth0 192.168.21.253
> > eth1 192.168.10.253

> > 192.168.0.253 is a Mitel SME server (192.168.10.254/192.168.11.10),
acting
> > as gateway to 192.168.11.0
> > IMHO, I need to add a route on eth0, 192.168.11.253 nm 255.255.255.0 gw
> > 192.168.10.254 ?

> I am not quite sure what you want to do, but if you want to force some
> interface, it is done using dev:

> route add -net x.y.z.t netmask 255.255.255.0 gw a.b.c.d dev eth1

> replacing 255.255.255.0 with appropriate mask, and eth1 with apropriate
> interface.

> But it is rarely necessary to explain which interface should be used.

> If you have smth like this:

>                              192.168.21.1     192.168.44.1
> --------------[box A]-------------------[box B]--------------[box C]-----
>            eth0     eth1                                           other
>  192.168.21.253     192.168.21.253                                 nets
>                                                                    here

> you should say
> route add -net 192.168.44.0 netmask 255.255.255.0 gw 192.168.21.1

> now you could use some host at .44.0 network as a gw (gateway) to
> some other network

> > Any help will be appreciated.

> > Thx

 
 
 

RH8 routing

Post by Kenneth A Kauffma » Sun, 18 May 2003 07:42:20




> Thanks for the reply, can I just create the /etc/sysconfig/static-routes
> file if it does not exsist? Can I just add routes with "route add -net
> x.y.z.t netmask 255.255.255.0 gw a.b.c.d dev eth1" within the file? Mitel
> uses "eth0 -net xxxx.netmask y.y.y.y gw z.z.z.z", must I use the first
one?

> Last one quick, how can I activate the routes without bouncing the box?

> Appreciate your help.




> > > Morning,

> > > A bit of a green question, but I have a RH8 box running purely as a
> > > router, the layout has just been added another dimention, which leaves
> me
> > > a bit dazed and confused :)

> > > How can I add a route to a specific interface?

> > > The router has 2 network cards.
> > > eth0 192.168.21.253
> > > eth1 192.168.10.253

> > > 192.168.0.253 is a Mitel SME server (192.168.10.254/192.168.11.10),
> acting
> > > as gateway to 192.168.11.0
> > > IMHO, I need to add a route on eth0, 192.168.11.253 nm 255.255.255.0
gw
> > > 192.168.10.254 ?

> > I am not quite sure what you want to do, but if you want to force some
> > interface, it is done using dev:

> > route add -net x.y.z.t netmask 255.255.255.0 gw a.b.c.d dev eth1

> > replacing 255.255.255.0 with appropriate mask, and eth1 with apropriate
> > interface.

> > But it is rarely necessary to explain which interface should be used.

> > If you have smth like this:

> >                              192.168.21.1     192.168.44.1
> > --------------[box A]-------------------[box B]--------------[box
C]-----
> >            eth0     eth1                                           other
> >  192.168.21.253     192.168.21.253                                 nets
> >                                                                    here

> > you should say
> > route add -net 192.168.44.0 netmask 255.255.255.0 gw 192.168.21.1

> > now you could use some host at .44.0 network as a gw (gateway) to
> > some other network

> > > Any help will be appreciated.

> > > Thx

RH8 doesn't use that configuration anymore.  If you put it in static-routes,
it will be ignored.  You need to create a file called
/etc/sysconfig/network-scripts/route-eth0  (replace device as necessary)
with the route in it in this format:

192.168.0.0/24 via 192.168.0.101

ken k

 
 
 

1. Simple routing using iptables @ RH8.0

I've got a RH8.0 default linux-box (tux-router) which I want to route my
trafix in between tux1 and tux2.

tux-router runs kernel 2.4.18 and has got:

eth0: 192.168.1.1
eth1: 192.168.2.1

The two client is:
tux1: 192.168.1.2
tux2: 192.168.2.2

tux-router's iptables is configured using:

### START
echo 0 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -F
/sbin/iptables -F
/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -P INPUT ACCEPT
# Masquerade
/sbin/iptables -v -t nat -A POSTROUTING -o eth1 -j MASQUERADE
# Allow established
/sbin/iptables -v -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -v -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Start
echo 1 > /proc/sys/net/ipv4/ip_forward
### END

This yields:

### START
MASQUERADE all opt -- in * out 192.168.2.1 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in * out * 0.0.0.0/0 -> 0.0.0.0/0 state
RELATED,ESTABLISHED
ACCEPT all opt -- in * out * 0.0.0.0/0 -> 0.0.0.0/0 state
RELATED,ESTABLISHED
### END

and the output of iptables -L is:

### START
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
### END

ip_forwading is enabled in /etc/sysctl.conf and apropriate modules is
loaded:

Module Size Used by Not tainted
ipt_LOG 4184 0 (autoclean)
ipt_state 1048 2 (autoclean)
ipt_MASQUERADE 2200 0 (autoclean)
iptable_nat 19960 0 (autoclean) [ipt_MASQUERADE]
ip_conntrack 21244 2 (autoclean) [ipt_state ipt_MASQUERADE iptable_nat]
autofs 13348 0 (autoclean) (unused)
pcnet32 17856 2
mii 2156 0 [pcnet32]
iptable_filter 2412 1 (autoclean)
ip_tables 14936 7 [ipt_LOG ipt_state ipt_MASQUERADE iptable_nat
iptable_filter]
ext3 70368 1
jbd 52212 1 [ext3]
BusLogic 100924 2
sd_mod 13552 4
scsi_mod 107144 2 [BusLogic sd_mod]

Additionally tux1 has a route (through tux-router) to the 192.168.2.0
network (where tux2 is located) ... but tux1 is not able to ping tux2.
tux2 doesn't have a route back to 192.168.1.0. Why?

Nils

2. Full duplex on x86 NIC card?

3. route problem: route forgot to specify route netmask.

4. A filter question......

5. Routing problem with source-based routing and routing packets back to sender machine.

6. Solaris Express Goes On !!!

7. building routing tables or listening to OSPF route information?

8. Syslogd spawning too much

9. defunct routes (was Re: multiple default routes appear in solaris 2.5.1)

10. routed adds wrong default route

11. policy routing (routing based on source IP)

12. Comparison of hardware routing and software routing

13. route forgot to specify route netmask.