[systemd-devel] [networkd] Mixing DHCP & static IPs on 1 interface

Kai Krakow hurikhan77 at gmail.com
Wed Feb 22 19:01:26 UTC 2017


Am Tue, 21 Feb 2017 18:30:07 -0600
schrieb Ian Pilcher <arequipeno at gmail.com>:

> I'm trying to find a way to do this with systemd-networkd.
> 
> The reason is that my cable modem listens on a 192.168.X.X address.
> Normally this "just works".  My firewall tries to send traffic
> destined for this address to my ISP's router, and the cable modem
> intercepts the packets and responds.
> 
> If I lose connectivity, however, my firewall doesn't have a default
> route, so it doesn't know where to send packets destined for
> 192.168.X.X.  The net result is that I lose connectivity to my cable
> modem's diagnostic pages at exactly the time that I need to access
> them. (OK, I don't really lose connectivity; I just have to manually
> add an IP address on the proper subnet to the firewall's external
> interface. It works, but it's so ... MANUAL!  :-)
> 
> My goal is to have both the DHCP assigned address (from my ISP) and
> the static address always configured on the external interface.  I've
> tried creating two separate .network files that match the interface,
> but only the DHCP address is getting assigned.  (The old network
> service actually is able to set this up on boot, but the static IP
> eventually goes away. I suspect that dhclient is deleting it when it
> renews its lease.)

The difference may be that the previous network script created alias
interfaces, like eth0:0, eth0:1...

You could try to create an alias interface with systemd-networkd, and
assign that the static IP. But how to do this is currently beyond my
knowledge.

-- 
Regards,
Kai

Replies to list-only preferred.



More information about the systemd-devel mailing list