You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

OCI: How to Create Network Route Rule Persistent Across OS Reboot Or Network Service Restart

edited Aug 9, 2023 3:38AM in Linux 2 comments

APPLIES TO

Oracle Cloud Infrastructure

Linux x86-64

GOAL

To create Network Route rule configuration to be persistent across Linux OS reboot.

Route rule temporarily added by executing below command. But this rule will disappear after a OS reboot or network service restart.

$ ip route add 1.0.0.xx/3x via 1x9.1xx.0.xx9 src 1x9.0.8x.x0
$ ip route add <Destination-Subnet> via <Gateway-IP-Of-Source> src <Source-IP-Address>

SOLUTION

1) Create a route file (route-ens3:0) under the directory /etc/sysconfig/network-scripts and add the route rules in it as below

$ vi /etc/sysconfig/network-scripts/route-ens3:0

$ cat /etc/sysconfig/network-scripts/route-ens3:0
1.0.0.xx/3x via 1x9.1xx.0.xx9 src 1x9.0.8x.x0
$

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!