Comment # 4 on bug 1202658 from
(In reply to Ralf Habacker from comment #3)
> (In reply to Marius Tomaschewski from comment #2)
> > Example showing the reason for using the incomplete static settings.
> > (while dhcp is in use and therefore there is no static IPADDR):
> 
> I think the use case I reported is a bit different:

No, it isn't. See bellow.

> $ ip addr
> ... 
> 2: enps03   
>    inet 10.1.1.30/24 metric 1024 brd 10.1.1.255 scope global dynamic enp0s3
> 
> The host has received an IP address from the DHCP server on the 10.1.1.0/24
> network.
> 
> $ ip route
> default via 10.1.1.250 dev enps03 proto dhcp 
> 10.1.1.250 dev enp0s3 proto dhcp scope link src 10.1.1.30 metric 1024 
> 10.1.1.0/24 dev enps03 proto kernel scope link src 10.1.1.30 metric 1024 
> 
> These settings were retrieved from the dhcp server.
> 
> If I add the static route manually after the network has been started and
> the host has received the IP configuration from the DHCP server (please note
> that the gateway for the static route is on the local network)

Yes, if and if.

The host _may_ receive something from DHCP server (at a random point of
time compared to apply time of the static settings) _or_ _not_ and it
_may_ (accidentially) provide also an IP address from a network that
matches the gateway from the static setup _or_ _not_.

> $ ip route add 10.2.1.1/32 via 10.1.1.252 dev enps03 
> 
> I did not receive an error message, instead the desired route was added.
> 
> $ ip route
> ...
> 10.2.1.1 via 10.1.1.252 dev enp0s3 
> 
> and is reachable
> 
> $ ping 10.2.1.1
> PING 10.2.1.1 (10.2.1.1) 56(84) bytes of data.
> 64 bytes of 10.2.1.1: icmp_seq=1 ttl=63 time=1.19 ms
> 
> If this works, why doesn't adding this route to
> /etc/sysconfig/network/ifroute-enps03 work?

Because the static settings (static "lease") in ifroute files and
the dhcp lease are two different leases "config sets" and applied
independently of each other -- without conditions or dependencies
between them. Both capable to provide the complete configuration
and both need to be complete by themself.

The clean way is to fix the dhcp server config to provide the
routes as described in bug 907495 to provide all routes via
dhcp (e.g. classless routes option).


You are receiving this mail because: