Bad IP route after restart network
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I would like to make a IP route persistent, but it disappears after a reboot or service restart.
here my net conf :
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:ce:1c:48 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.56/16 brd 10.0.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.255.255.24/9 brd 10.255.255.255 scope global eth0:23
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fece:1c48/64 scope link
valid_lft forever preferred_lft forever
cat ifcfg-eth0
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.56
NETMASK=255.255.0.0
GATEWAY=10.0.0.1
cat ifcfg-eth0:23
ONBOOT=yes
DEVICE=eth0:23
BOOTPROTO=static
IPADDR=10.255.255.24
CONNECTED_MODE=yes
NETMASK=255.128.0.0
GATEWAY=10.0.0.1
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 0.0.0.0 255.128.0.0 U 0 0 0 eth0
When i want ping 10.128.0.1, I can't do it !
On the other hand, when i run this command :
ip r d 10.128.0.0/9 ; ip r a 10.128.0.0/9 via 10.0.0.1
i can ping my other server (10.128.0.1) and my route is corrected.
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 10.0.0.1 255.128.0.0 UG 0 0 0 eth0
ping 10.128.0.1
PING 10.128.0.1 (10.128.0.1) 56(84) bytes of data.
64 bytes from 10.128.0.1: icmp_seq=1 ttl=64 time=0.124 ms
64 bytes from 10.128.0.1: icmp_seq=2 ttl=64 time=0.109 ms
Yet I took the care to add the route file in /etc/sysconfig/network-scripts/route-eth0
Like this :
default via 10.0.0.1 dev eth0
10.128.0.0/9 via 10.0.0.1 dev eth0
I don't understand why my route is wrong.
linux networking rhel network-interface iproute
add a comment |Â
up vote
2
down vote
favorite
I would like to make a IP route persistent, but it disappears after a reboot or service restart.
here my net conf :
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:ce:1c:48 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.56/16 brd 10.0.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.255.255.24/9 brd 10.255.255.255 scope global eth0:23
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fece:1c48/64 scope link
valid_lft forever preferred_lft forever
cat ifcfg-eth0
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.56
NETMASK=255.255.0.0
GATEWAY=10.0.0.1
cat ifcfg-eth0:23
ONBOOT=yes
DEVICE=eth0:23
BOOTPROTO=static
IPADDR=10.255.255.24
CONNECTED_MODE=yes
NETMASK=255.128.0.0
GATEWAY=10.0.0.1
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 0.0.0.0 255.128.0.0 U 0 0 0 eth0
When i want ping 10.128.0.1, I can't do it !
On the other hand, when i run this command :
ip r d 10.128.0.0/9 ; ip r a 10.128.0.0/9 via 10.0.0.1
i can ping my other server (10.128.0.1) and my route is corrected.
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 10.0.0.1 255.128.0.0 UG 0 0 0 eth0
ping 10.128.0.1
PING 10.128.0.1 (10.128.0.1) 56(84) bytes of data.
64 bytes from 10.128.0.1: icmp_seq=1 ttl=64 time=0.124 ms
64 bytes from 10.128.0.1: icmp_seq=2 ttl=64 time=0.109 ms
Yet I took the care to add the route file in /etc/sysconfig/network-scripts/route-eth0
Like this :
default via 10.0.0.1 dev eth0
10.128.0.0/9 via 10.0.0.1 dev eth0
I don't understand why my route is wrong.
linux networking rhel network-interface iproute
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I would like to make a IP route persistent, but it disappears after a reboot or service restart.
here my net conf :
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:ce:1c:48 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.56/16 brd 10.0.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.255.255.24/9 brd 10.255.255.255 scope global eth0:23
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fece:1c48/64 scope link
valid_lft forever preferred_lft forever
cat ifcfg-eth0
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.56
NETMASK=255.255.0.0
GATEWAY=10.0.0.1
cat ifcfg-eth0:23
ONBOOT=yes
DEVICE=eth0:23
BOOTPROTO=static
IPADDR=10.255.255.24
CONNECTED_MODE=yes
NETMASK=255.128.0.0
GATEWAY=10.0.0.1
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 0.0.0.0 255.128.0.0 U 0 0 0 eth0
When i want ping 10.128.0.1, I can't do it !
On the other hand, when i run this command :
ip r d 10.128.0.0/9 ; ip r a 10.128.0.0/9 via 10.0.0.1
i can ping my other server (10.128.0.1) and my route is corrected.
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 10.0.0.1 255.128.0.0 UG 0 0 0 eth0
ping 10.128.0.1
PING 10.128.0.1 (10.128.0.1) 56(84) bytes of data.
64 bytes from 10.128.0.1: icmp_seq=1 ttl=64 time=0.124 ms
64 bytes from 10.128.0.1: icmp_seq=2 ttl=64 time=0.109 ms
Yet I took the care to add the route file in /etc/sysconfig/network-scripts/route-eth0
Like this :
default via 10.0.0.1 dev eth0
10.128.0.0/9 via 10.0.0.1 dev eth0
I don't understand why my route is wrong.
linux networking rhel network-interface iproute
I would like to make a IP route persistent, but it disappears after a reboot or service restart.
here my net conf :
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 52:54:00:ce:1c:48 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.56/16 brd 10.0.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet 10.255.255.24/9 brd 10.255.255.255 scope global eth0:23
valid_lft forever preferred_lft forever
inet6 fe80::5054:ff:fece:1c48/64 scope link
valid_lft forever preferred_lft forever
cat ifcfg-eth0
ONBOOT=yes
DEVICE=eth0
BOOTPROTO=static
IPADDR=10.0.0.56
NETMASK=255.255.0.0
GATEWAY=10.0.0.1
cat ifcfg-eth0:23
ONBOOT=yes
DEVICE=eth0:23
BOOTPROTO=static
IPADDR=10.255.255.24
CONNECTED_MODE=yes
NETMASK=255.128.0.0
GATEWAY=10.0.0.1
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 0.0.0.0 255.128.0.0 U 0 0 0 eth0
When i want ping 10.128.0.1, I can't do it !
On the other hand, when i run this command :
ip r d 10.128.0.0/9 ; ip r a 10.128.0.0/9 via 10.0.0.1
i can ping my other server (10.128.0.1) and my route is corrected.
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.128.0.0 10.0.0.1 255.128.0.0 UG 0 0 0 eth0
ping 10.128.0.1
PING 10.128.0.1 (10.128.0.1) 56(84) bytes of data.
64 bytes from 10.128.0.1: icmp_seq=1 ttl=64 time=0.124 ms
64 bytes from 10.128.0.1: icmp_seq=2 ttl=64 time=0.109 ms
Yet I took the care to add the route file in /etc/sysconfig/network-scripts/route-eth0
Like this :
default via 10.0.0.1 dev eth0
10.128.0.0/9 via 10.0.0.1 dev eth0
I don't understand why my route is wrong.
linux networking rhel network-interface iproute
linux networking rhel network-interface iproute
edited Sep 5 at 17:53
Rui F Ribeiro
36.8k1273117
36.8k1273117
asked Sep 5 at 15:39
BlaST77
111
111
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Check your eth0:23
configuration.
Its address overlaps with 10.128.0.0/9
so it looks to the system as directly connected. That's why the system won't let you add a route through the default gateway!
You can see by route -n
that the gateway is 0.0.0.0
, which means directly connected, so the line
10.128.0.0/9 via 10.0.0.1 dev eth0
cannot be execute (it probably gives an error in some log file, too).
Obviously, when you explicitly delete the route, then the system lets you add a route via the default gateway as it no more have another route (the directly connected one) in its tables.
To fix this, you have to delete the eth0:23
interface, as 10.128.0.0/9 it's not a connected network and you shouldn't have an IP address on that machine.
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Check your eth0:23
configuration.
Its address overlaps with 10.128.0.0/9
so it looks to the system as directly connected. That's why the system won't let you add a route through the default gateway!
You can see by route -n
that the gateway is 0.0.0.0
, which means directly connected, so the line
10.128.0.0/9 via 10.0.0.1 dev eth0
cannot be execute (it probably gives an error in some log file, too).
Obviously, when you explicitly delete the route, then the system lets you add a route via the default gateway as it no more have another route (the directly connected one) in its tables.
To fix this, you have to delete the eth0:23
interface, as 10.128.0.0/9 it's not a connected network and you shouldn't have an IP address on that machine.
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
 |Â
show 2 more comments
up vote
1
down vote
Check your eth0:23
configuration.
Its address overlaps with 10.128.0.0/9
so it looks to the system as directly connected. That's why the system won't let you add a route through the default gateway!
You can see by route -n
that the gateway is 0.0.0.0
, which means directly connected, so the line
10.128.0.0/9 via 10.0.0.1 dev eth0
cannot be execute (it probably gives an error in some log file, too).
Obviously, when you explicitly delete the route, then the system lets you add a route via the default gateway as it no more have another route (the directly connected one) in its tables.
To fix this, you have to delete the eth0:23
interface, as 10.128.0.0/9 it's not a connected network and you shouldn't have an IP address on that machine.
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
 |Â
show 2 more comments
up vote
1
down vote
up vote
1
down vote
Check your eth0:23
configuration.
Its address overlaps with 10.128.0.0/9
so it looks to the system as directly connected. That's why the system won't let you add a route through the default gateway!
You can see by route -n
that the gateway is 0.0.0.0
, which means directly connected, so the line
10.128.0.0/9 via 10.0.0.1 dev eth0
cannot be execute (it probably gives an error in some log file, too).
Obviously, when you explicitly delete the route, then the system lets you add a route via the default gateway as it no more have another route (the directly connected one) in its tables.
To fix this, you have to delete the eth0:23
interface, as 10.128.0.0/9 it's not a connected network and you shouldn't have an IP address on that machine.
Check your eth0:23
configuration.
Its address overlaps with 10.128.0.0/9
so it looks to the system as directly connected. That's why the system won't let you add a route through the default gateway!
You can see by route -n
that the gateway is 0.0.0.0
, which means directly connected, so the line
10.128.0.0/9 via 10.0.0.1 dev eth0
cannot be execute (it probably gives an error in some log file, too).
Obviously, when you explicitly delete the route, then the system lets you add a route via the default gateway as it no more have another route (the directly connected one) in its tables.
To fix this, you have to delete the eth0:23
interface, as 10.128.0.0/9 it's not a connected network and you shouldn't have an IP address on that machine.
answered Sep 5 at 15:48
Mr Shunz
2,62011619
2,62011619
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
 |Â
show 2 more comments
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
Effectively, but i need IP address 10.255.255.24/9. do you have other suggestions ?
â BlaST77
Sep 6 at 8:06
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
@BlaST77 How can that IP be reached if it's not directly connected? Can you update your question sharing a bit more information on your network setup?
â Mr Shunz
Sep 6 at 8:41
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
it's a virtual machine. VM : 10.0.0.56/16 ; 10.255.255.24/9 Hypervisor : 10.0.0.1/16 ; 10.128.0.1/9 The network 10.0.0.0/16 is connected on a bridge. IP 10.128.0.1 in Hypervisor is the real card
â BlaST77
Sep 6 at 12:27
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
@BlaST77 well, it won't matter if it's virtual or not. If you need to go through 10.0.0.1 to reach the 10.128.0.0/9 network, your machine SHOULD NOT have an address in that network.
â Mr Shunz
Sep 6 at 12:30
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
if I need this VM have the address 10.255.255.24 because this VM is a server and the listening IP is 10.255.255.24. the clients of this server are in the 10.128.0.0/9 network. You understand ?
â BlaST77
Sep 6 at 12:33
 |Â
show 2 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467055%2fbad-ip-route-after-restart-network%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password