RHEL 7 - Add static route persistent/permanently
Check current route
# ip route show
default via 10.1.1.1 dev enp0s3 proto static metric 1024
10.0.0.0/8 dev enp0s3 proto kernel scope link src 10.1.1.110
Add to persistent route
To add destination 15.15.0.0/24 via ip 10.1.1.110 using interface enp0s3
# cat /etc/sysconfig/network-scripts/route-enp0s3
15.15.0.0/24 via 10.1.1.110 dev enp0s3
Restart network & verify
# ip route show
default via 10.1.1.1 dev enp0s3 proto static metric 1024
10.0.0.0/8 dev enp0s3 proto kernel scope link src 10.1.1.110
Add to persistent route
To add destination 15.15.0.0/24 via ip 10.1.1.110 using interface enp0s3
# cat /etc/sysconfig/network-scripts/route-enp0s3
15.15.0.0/24 via 10.1.1.110 dev enp0s3
Restart network & verify
0 Comments:
Post a Comment
<< Home