There is a SLES12 with 10.2.64.x IP.
I want to add an additional one, a 10.2.50.x IP.
Before, the routing looks like this:
SERVER:~ # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.2.64.1 0.0.0.0 UG 0 0 0 foo
10.2.64.0 0.0.0.0 255.255.255.0 U 0 0 0 foo
...
SERVER:~ #
Then I am bringing up the new 10.2.50.x IP:
SERVER:~ # ifup foo2
foo2 up
SERVER:~ #
Then the routing looks like this:
SERVER:~ # netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 10.2.64.1 0.0.0.0 UG 0 0 0 foo
10.2.50.0 0.0.0.0 255.255.255.0 U 0 0 0 foo2
10.2.64.0 0.0.0.0 255.255.255.0 U 0 0 0 foo
...
SERVER:~ #
So looks like the 10.2.50.0 packets would go in a wrong direction (???), so I delete that:
SERVER:~ # ip route del 10.2.50.0/24 via 0.0.0.0 dev foo2
SERVER:~ #
And then I am trying to add the good routing entry (at least AFAIK):
SERVER:~ # ip route add 10.2.50.0/24 via 10.2.50.1 dev foo2
RTNETLINK answers: Network is unreachable
SERVER:~ #
SERVER:~ # ping -c 1 -w 1 10.2.50.1|grep loss
1 packets transmitted, 1 received, 0% packet loss, time 0ms
SERVER:~ # ifdown foo2
SERVER:~ #
But I got "RTNETLINK answers: Network is unreachable".
The Q: what am I missing? Why can't I add the proper routing entry?
Additionally, while the foo2 is UP, I cannot ping the 10.2.64.x IP.
I am not a networking guy. Just want that there would be these two IPs with correct routing :)