LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-02-2015, 10:56 PM   #1
dara.hr
LQ Newbie
 
Registered: Sep 2010
Posts: 15

Rep: Reputation: 0
route persist issue


Hi,

I have to NIC tith below info:
  • NIC1 :
    IP : 10.10.10.5
    Netmask : 255.255.255.255
    eth : eth0

    NIC2 :
    IP : 10.10.10.6
    Netmask : 255.255.255.255
    eth : eth1

My gateway for both of these IPs is 10.10.10.1/32

I can successfully route these IPs using below command :

Code:
Append these two lines to /etc/iproute2/rt_tables
200 nic1
201 nic2

route add -net 10.10.10.1 netmask 255.255.255.255 dev eth0
route add -net 10.10.10.1 netmask 255.255.255.255 dev eth1

route add default gw 10.10.10.1 dev eth0
route add default gw 10.10.10.1 dev eth1

ip route add 0/0 via 10.10.10.1 dev eth0 table nic1
ip route add 0/0 via 10.10.10.1 dev eth1 table nic2

ip rule add from 10.10.10.5 table nic1
ip rule add to 10.10.10.5 table nic1

ip rule add from 10.10.10.6 table nic2
ip rule add to 10.10.10.6 table nic2
but unfortunately i can not persist these routes ant rules in route-ethX and rule-ethX.

Also when I'm using ip route command instead od route add these routes did not work anymore.

anybody can help me.

Last edited by dara.hr; 11-02-2015 at 11:07 PM.
 
Old 11-03-2015, 03:02 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
What do you try to do? Why is netmask 255.255.255.255?
 
Old 11-03-2015, 05:36 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Statements like "it doesn't work" are too unspecific to even try guessing what's going on, in particular if you don't show the steps you have taken so far.

It would help if you included:
  • the ip route command you tried
  • the output of that command, in particluar error messages
  • the routing table after the route add and the ip route add commands
  • the content of your configuration files
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is this the fastest route to 'Dependency issue Hell'? Robert.Thompson Slackware 34 07-14-2011 02:58 AM
ip route + ip tables + 2 lan ip's + 2 isps only 1 issue! exodist Linux - Networking 1 04-13-2008 09:59 PM
Static route issue unixfool Linux - Networking 1 05-19-2006 03:56 PM
Route and Resolv.conf Issue FrodoNeil Linux - Networking 2 12-07-2004 11:55 PM
Slackware 10 route issue odysseynetwork Linux - Networking 2 10-06-2004 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration