0

I am new to linux. I want to add below permanent route:

[root@Docker1 ~]# route -n | grep 10.246.179.0
10.246.179.0    0.0.0.0         255.255.255.192 U     0      0        0 eth0

I added a file named route-eth0 in network-scripts as below:

10.246.179.0/24 via 0.0.0.0 dev eth0

But instead of 255.255.255.192, I am getting route as below:

10.246.179.0    0.0.0.0    255.255.255.0   U   0    0     0    eth0

What should I do to get the desired result? I am on RHEL 6.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • 1
    Dude...that's not linux specific. Would you please check your CIDR notation and netmask and _maybe_ find the error? – Lenniey Feb 21 '20 at 10:13

1 Answers1

1

You are providing a /24 netmask, which results in .0.

There are several subnet calculators available on the internet, you can use any one of them to get that the correct netmask for .192 is /26.

10.246.179.0/26 via 0.0.0.0 dev eth0
Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89