Networking Forums

Networking Forums > Computer Networking > Linux Networking > Help with a simply routing table

Reply
Thread Tools Display Modes

Help with a simply routing table

 
 
Juanjillo
Guest
Posts: n/a

 
      03-18-2010, 10:42 AM
Hello,

I need to put some static routes in Ubuntu Server 9.10.

Mi default GW is 172.16.4.240 and my network mask is 255.255.252.0

I want to all the trafic for a subnet 172.16.20.0 goes for other
gateway (172.26.4.20), but for only one ip the trafic goes for the
default gateway.

I add this in /etc/network/interfaces

#Static Routes
up route add -net 172.16.20.0/22 gw 172.16.4.20 dev eth0
up route add -host 172.16.20.240 gw 172.16.4.240 dev eth0

I restart the network and give some errors and doesn´t work.

Is this the correct way to do it?
Any advice?

Thanks.
Kind regards.


 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      03-19-2010, 02:19 PM
On 18.3.10 1:42 , Juanjillo wrote:
> Hello,
>
> I need to put some static routes in Ubuntu Server 9.10.
>
> Mi default GW is 172.16.4.240 and my network mask is 255.255.252.0
>
> I want to all the trafic for a subnet 172.16.20.0 goes for other gateway
> (172.26.4.20), but for only one ip the trafic goes for the default gateway.
>
> I add this in /etc/network/interfaces
>
> #Static Routes
> up route add -net 172.16.20.0/22 gw 172.16.4.20 dev eth0
> up route add -host 172.16.20.240 gw 172.16.4.240 dev eth0
>
> I restart the network and give some errors and doesn´t work.
>
> Is this the correct way to do it?
> Any advice?



Please post the error messages, and the output of

/sbin/route -n

--

Tauno Voipio
tauno voipio (at) iki fi


 
Reply With Quote
 
klaus zerwes
Guest
Posts: n/a

 
      03-19-2010, 03:17 PM
Juanjillo wrote:
> Hello,


Hello

> I need to put some static routes in Ubuntu Server 9.10.
>
> Mi default GW is 172.16.4.240 and my network mask is 255.255.252.0
>
> I want to all the trafic for a subnet 172.16.20.0 goes for other gateway
> (172.26.4.20), but for only one ip the trafic goes for the default gateway.
>
> I add this in /etc/network/interfaces
>
> #Static Routes
> up route add -net 172.16.20.0/22 gw 172.16.4.20 dev eth0
> up route add -host 172.16.20.240 gw 172.16.4.240 dev eth0


Probably this is not the cause of the error you get, but you must change
the order of the two "up" commands.
Routing works like "first match wins" and 172.16.20.240 will always
match 172.16.20.0/22.

Do you really need the "dev eth0" part?
If not, leave it away. It may only cause you headache if you insert
another NIC into the server.

> I restart the network and give some errors and doesn´t work.


Please post the error message, so we all may see what you are speaking
about.

> Is this the correct way to do it?
> Any advice?
>
> Thanks.
> Kind regards.


Klaus


--
Klaus Zerwes
http://www.zero-sys.net
 
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 Table Issue DHK Windows Networking 12 07-20-2009 04:35 PM
Routing Table for JonnyCAD JonnyCAD Windows Networking 0 12-05-2006 11:45 AM
Routing table Matt Scoff Windows Networking 6 06-08-2006 02:19 AM
How to use second routing table? Martin Pauly Linux Networking 0 03-08-2005 04:54 PM
NAP routing table dumps Peter Network Routers 0 09-13-2004 01:26 PM



1 2 3 4 5 6 7 8 9 10 11