Skip to content

Commit

Permalink
network.service: Add default route
Browse files Browse the repository at this point in the history
Add the setting of the default route into this service. This is supposed
to replace gateway.service which should be removed, if this is merged.

The problem with two different services is, that the system looses the
route when network.service is stopped. Currently, gateway.service is
also stopped, because of a Requires= dependency, but not restarted, when
network.service is restarted. Downgrading the dependency to Wants=
wouldn't resolve the problem, because the system looses the route anyway
when the ip address is removed.

If we make sure, that we add the route every time we set the ip
address, we can restart network.service without loosing the default
route. The services are not independent anyway, because the gateway ip
address must be on a local network and thus match the ip address used by
this unit.
  • Loading branch information
donald committed May 16, 2019
1 parent d8301a5 commit 9db11c1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions misc_systemd_units/network.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RemainAfterExit=yes
ExecStart=/usr/sbin/mxnetctl start
ExecStart=/sbin/ip addr add ${MX_IPADDR}/20 broadcast 141.14.31.255 dev ${MX_NETDEV}
ExecStart=/sbin/ip link set up dev ${MX_NETDEV}
ExecStart=/sbin/ip route add default via 141.14.16.128
ExecStop=/sbin/ip addr del ${MX_IPADDR}/20 dev ${MX_NETDEV}
StandardOutput=syslog

Expand Down

0 comments on commit 9db11c1

Please sign in to comment.