3

I have following list of route addresses which I need to add in /etc/sysconfig/network-scripts/route-eth0 file in order to make it permanent add.

route add -net 101.122.122.0 netmask 255.255.248.0 gw 10.0.0.10
route add -net 132.138.109.3 netmask 255.255.255.255 gw 10.0.0.10
route add -net 224.0.0.0 netmask 240.0.0.0 gw 10.0.0.10
route add -net 147.255.255.255 netmask 255.255.255.255 gw 10.0.0.10
route add -net 102.128.172.2 netmask 255.255.252.0 gw 10.0.0.10

In Windows it is simple to add. It can be achieved by adding just -p option with route command and it makes it permanent. What will be the file format for Linux.

Update:

ifconfig command does not list eth0 interface.

ip route show gives following output:

default via 10.0.0.20 dev enp0s25  proto static  metric 100 
default via 10.0.0.20 dev wlp4s0  proto static  metric 600 
10.0.0.0/22 dev enp0s25  proto kernel  scope link  src 10.0.3.90  metric 100 
10.0.0.0/22 dev wlp4s0  proto kernel  scope link  src 10.0.3.59  metric 600 
192.22.132.0/24 dev virbr0  proto kernel  scope link  src 192.22.132.1 linkdown 
4
  • 1
    As you add them to route-eth0 they are permanent. The will exist every time network interface is started/restarted. But why you add host as network? And why you do not use proper syntax for networks? Apr 26, 2017 at 10:10
  • I many not be able to understand your question but I tried docs.fedoraproject.org/en-US/Fedora/14/html/Deployment_Guide/… with no luck.
    – snoop
    Apr 26, 2017 at 10:12
  • What is the output of ip route show ?
    – GAD3R
    Apr 26, 2017 at 13:30
  • @GAD3R question updated.
    – snoop
    Apr 27, 2017 at 4:50

0

You must log in to answer this question.

Browse other questions tagged .