i added route on server . Why can't I see the ip address under gatewey
route add -net 10.6.51.64 netmask 255.255.255.248 gw 10.156.254.33
[root@test1~]# route
Destination Gateway Genmask Flags Metric Ref Use Iface
default gateway 0.0.0.0 UG 0 0 0 bond1
10.6.51.64 gateway 255.255.255.248 UG 0 0 0 bond1
10.140.23.42 gateway 255.255.255.255 UGH 0 0 0 bond1
10.156.254.32 0.0.0.0 255.255.255.224 U 0 0 0 bond1
route
Re: route
route is an old tool. A more advanced alternative, the iproute2 package was introduced two decades ago.
(I never bothered to learn to read the output of 'route'.)
The iproute2 shows routes with:
(which is actually a shorthand for ip route show)
One would add a route with:
However, if you do have NetworkManager.service in use (which is the default), the you would not set route with 'ip' (or 'route'), except temporarily. You would would configure your connections with NM.
For example (assuming the name of connection is 'bond1'):
(I never bothered to learn to read the output of 'route'.)
The iproute2 shows routes with:
Code: Select all
ip ro
One would add a route with:
Code: Select all
ip ro add 10.6.51.64/29 via 10.156.254.33
For example (assuming the name of connection is 'bond1'):
Code: Select all
nmcli connection modify bond1 +ipv4.routes "10.6.51.64/29 10.156.254.33"