nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

Routing tables flushed

This is a discussion on Routing tables flushed within the Linux hardware forums, part of the Linux Getting Started category; We have a gateway server fedora 6 with kernel version 2.6.18 which has a challenging problem different routing tables have ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux hardware

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-05-2007, 10:52 PM
Junior Member
User
 
Join Date: Jun 2007
My distro: FEDORA
Posts: 3
Rep Power: 0
milank is on a distinguished road
Default Routing tables flushed

We have a gateway server fedora 6 with kernel version 2.6.18 which has a challenging problem different routing tables have been created under /etc/iproute2/rt_tables as the server has multiple outbound links over a single network interface and these these tables have been marked with fwmark values associated with iptables to mark different traffic(different protocols and source addresseand each table has different gateways to different outbound links.The problem is when the server reboots all the virtual routing tables get flushed out and only the default table with default gateway is what remains.Is there a way or method which would preserve these tables even if server reboots,then please advice.Example of output:
ip rule
32764: from all fwmark 0x20 lookup www
32767: from all lookup default.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-12-2007, 07:08 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 578
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Add your route command to /etc/rc.local or configure static routes
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #3 (permalink)  
Old 12-07-2007, 10:54 AM
anilvrathod's Avatar
Junior Member
User
 
Join Date: Dec 2007
Location: Pune
My distro: Red Hat
Posts: 13
Rep Power: 0
anilvrathod is on a distinguished road
Default Routing Table

Hi,
Your server act as a Gateway machine , it means your server have 2 NIC.
If your structure is as follow:
WAN IP
|
|
----------------NIC A------------------
| LINUX BOX |
-------------NIC B --------------------
|
|
intranet
suppose NIC (eth0)--- A ---- have a WAN IP such as AAA.AAA.AAA.AAA
NIC (eth1)----B ------have a Local class C IP such as 192.168.1.0-524 (range )
then if you want to write/set routing table then pls do as following :

vi /etc/sysconfig/network-script/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
AAA.AAA.AAA.AAA
GATEWAY=routers' another end IP which is connected to outside of world (WAN IP)
NETMASK=255.255.255.248
ONBOOT=yes
TYPE=Ethernet

vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet



And if your machine have a single NIC then

vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=
192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
and add DEFAULT routing table as follow

1.route add default gw AAA.AAA.AAA.AAA(WAN IP )

Reply With Quote
  #4 (permalink)  
Old 12-24-2007, 11:51 AM
Junior Member
User
 
Join Date: Dec 2007
My distro: fedora
Posts: 2
Rep Power: 0
javed is on a distinguished road
Default thanks

hi
thanks dear for the Scrapt


Quote:
Originally Posted by anilvrathod View Post
Hi,
Your server act as a Gateway machine , it means your server have 2 NIC.

If your structure is as follow:
WAN IP
|
|
----------------NIC A------------------
| LINUX BOX |
-------------NIC B --------------------
|
|
intranet
suppose NIC (eth0)--- A ---- have a WAN IP such as AAA.AAA.AAA.AAA
NIC (eth1)----B ------have a Local class C IP such as 192.168.1.0-524 (range )
then if you want to write/set routing table then pls do as following :


vi /etc/sysconfig/network-script/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=AAA.AAA.AAA.AAA
GATEWAY=routers' another end IP which is connected to outside of world (WAN IP)
NETMASK=255.255.255.248
ONBOOT=yes
TYPE=Ethernet
vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet


And if your machine have a single NIC then
vi /etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth0
BOOTPROTO=static
HWADDR=xxxxxxxxxx
IPADDR=192.168.1.254
GATEWAY=AAA.AAA.AAA.AAA
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
and add DEFAULT routing table as follow
1.route add default gw AAA.AAA.AAA.AAA(WAN IP )
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
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 On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Routing/copying data from eth0 and send over eth1 and eth2 theVOID Networking, Firewalls and Security 2 04-14-2008 05:02 PM
Routing Tables flushed milank CentOS / RHEL / Fedora 0 11-05-2007 11:26 PM
IP Tables Configuration jhn_daz@yahoo.com Networking, Firewalls and Security 2 07-23-2007 03:40 AM
How to List my tables in Oracle database Databases servers 3 12-20-2006 03:25 PM
Routing rajuk Linux software 3 06-16-2006 06:08 PM


All times are GMT +5.5. The time now is 04:39 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36