IP Route add default and make permanet


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat IP Route add default and make permanet
# 1  
Old 09-24-2016
RedHat IP Route add default and make permanet

Hi all,
actually i'm facing this problem,
we have 2 NICs on our VM.s with REDHAT 7.2 release,
we made the following set up as we needed to access them from both IP

Code:
ip route flush all 
ip route add 10.130.11.0/24 dev eno2 tab 1 
ip route add 10.130.10.0/24 dev eno1 tab 2 
ip route add default via 10.130.11.1 dev eno2 tab 1 
ip route add default via 10.130.10.1 dev eno1 tab 2 
ip route add default via 10.130.11.1 tab 1 
ip route add default via 10.130.10.1 tab 2 
ip rule add from 10.130.11.0/24 tab 1 priority 100 
ip rule add from 10.130.10.0/24 tab 2 priority 200 
echo "net.ipv4.conf.all.rp_filter = 2"|sudo tee /etc/sysctl.d/99-rp_filter.conf 
echo "GATEWAY=10.130.11.1" >> /etc/sysconfig/network-scripts/ifcfg-eno2 
cd /etc/sysconfig/network-scripts/ 
sed -i -e 's/GATEWAY=10.130.10.1/ /g' ifcfg-eno1
ip route flush cache 
systemctl restart network

The access is working fine, but i'm not sure if the configurations are keeps after a system reboot,

and the other issue is that, when trying to copy a file from another server to one of the above IP's 10.130.10.12 or 10.130.11.12 the copy gets stalled,

and temporaly adding the ip route tables as following solves the problem,

Code:
ip route add default via 10.130.10.1 table 1
ip route add default via 10.130.11.1 table 2

Could somebody help me set the tables to be permanent after network restart?

Thank you in advance.

Last edited by charli1; 09-24-2016 at 11:14 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Default Route add fails

AIX version 5.3 when I try to add default gateway # route add 0 192.168.100.254 Or # route add default 192.168.100.254 I get the error 0821-275 route: socket: The file access permissions do not allow the specified action. searching on google i came across similar... (5 Replies)
Discussion started by: filosophizer
5 Replies

2. Solaris

Add route to solaris 10

I need to add a new route on solaris10 machine. I want that all traffic on the 23 port (telnet) use 192.168.200.1 gateway. How I do ? Thank you in advance. (1 Reply)
Discussion started by: arfry
1 Replies

3. Solaris

Add route to solaris10

Hi need to add 2 routes, one on each server. I know the route add comand but I have always been given the parameters to put in. I need a route in each of the 2 following servers to be able to ping and ssh between them. But how do i know which netmask to put in the route add command ? In... (6 Replies)
Discussion started by: vettec3
6 Replies

4. IP Networking

route add

I have built a new linux server, via a iLo connection. and I am trying to connect via my desktop to the server I have just built to the management port eth0 via putty. Please could some one advise how to connect to this server from my desktop. Do i need to create add a route access on the... (0 Replies)
Discussion started by: venhart
0 Replies

5. Solaris

how do i make a route entry permanent in the routing table on solaris 8?

how do I make sure that the entry in the routing table on Solaris 8 stay permanent after rebooting the server. For example route add 172.20.1.60 -netmask 255.255.255.0 172.20.255.253 Each time the server reboots the entry disappears when using the command netstat -nr (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies

6. Solaris

Route Add

Hi, I am trying to add route command in Solaris 10 machine in the following fashion: route add -host 10.8.112.10 180.144.1.250 -interface lo0:1 this command fails with an error "lo0:1: bad value" I want to add a route to 10.8.112.10 that picks 180.144.1.250 as the gateway via the... (3 Replies)
Discussion started by: sudhir_shet
3 Replies

7. IP Networking

Route add probleme

I have a system that i want to reach via a vpn created vi a fierwall.The fierwall in an other system. The ip i am trying to get to is 172.16.4.48 I need to get to it via the hme1 interface. The vpn gateway has this ip 172.30.50.1 I need to clean up the routing table and make this work; or is it... (5 Replies)
Discussion started by: waterboy
5 Replies

8. IP Networking

Do I need to add a route??

I have two networks connected by cisco routers. My first subnet is 192.168.0.0 and my second is 192.168.1.0. My SCO unix machine is on the 192.168.1.0 subnet with an IP of 192.168.1.231. It can see the entire .1.0 subnet but nothing on the other network. My cicso router(gateway) to the other... (6 Replies)
Discussion started by: agoodrich
6 Replies

9. AIX

route add

Hello , We have 3 rs/6000 server's running aix on our local network, so each time I try to ping one of these servers we get a "network is down" error , I've been instructed to use to route add command which is ... #route add server.ip router.ip after this the ping command works fine ,... (6 Replies)
Discussion started by: cubicle^dweller
6 Replies
Login or Register to Ask a Question