P
P
panaceya2015-05-28 14:33:26
Network routing
panaceya, 2015-05-28 14:33:26

Why doesn't route work in dhcpd?

Hello!
I have DHCPd, the routers option is set in it and there are several IPs (6) in the parameters. The problem is that the client on CentOS 7 does not route when the 2nd (10.1.2.10) server in the list from routers is present on the network.

subnet 10.1.0.0 netmask 255.255.252.0 {
...
        option routers                  10.1.3.254, 10.1.2.10, 10.1.2.254, 10.1.1.254, 10.1.0.254, 10.1.0.1;
}

Customer
[[email protected] ~]# ip route
default via 10.1.3.254 dev eth0 
default via 10.1.2.10 dev eth0  metric 1 
default via 10.1.2.254 dev eth0  metric 2 
default via 10.1.1.254 dev eth0  metric 3 
default via 10.1.0.254 dev eth0  metric 4 
default via 10.1.0.1 dev eth0  metric 5 
10.1.0.0/22 dev eth0  proto kernel  scope link  src 10.1.2.1 

[[email protected] ~]# ping 10.1.2.10 -c 5
PING 10.1.2.10 (10.1.2.10) 56(84) bytes of data.
64 bytes from 10.1.2.10: icmp_seq=1 ttl=64 time=0.238 ms
64 bytes from 10.1.2.10: icmp_seq=2 ttl=64 time=0.254 ms
64 bytes from 10.1.2.10: icmp_seq=3 ttl=64 time=0.285 ms
64 bytes from 10.1.2.10: icmp_seq=4 ttl=64 time=0.317 ms
64 bytes from 10.1.2.10: icmp_seq=5 ttl=64 time=0.250 ms

--- 10.1.2.10 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.238/0.268/0.317/0.035 ms
[[email protected] ~]# ping 8.8.8.8 -c 5
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 10.1.2.1 icmp_seq=1 Destination Host Unreachable
From 10.1.2.1 icmp_seq=2 Destination Host Unreachable
From 10.1.2.1 icmp_seq=3 Destination Host Unreachable
From 10.1.2.1 icmp_seq=4 Destination Host Unreachable
From 10.1.2.1 icmp_seq=5 Destination Host Unreachable

--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4000ms
pipe 4

The router naturally sees the network. If you specify only one router IP in option routers, everything works fine. In theory, the client should ask 10.1.3.254, if he does not answer, then further 10.1.2.10, etc.
This is my mistake somewhere (or I don’t understand) and what is the reason?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
M
mureevms, 2015-05-28
@mureevms

From documentation:

option routers ip-address [, ip-address...];
List of router IP addresses for the client network. Routers should be listed in order of preference.

Those. you only need to specify the gateway address for each subnet. You have two addresses on 10.1.2.0 and 10.1.0.0 subnets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question