From c0a520f32a3c70aefc393f74ced365004fe8be75 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 16 Feb 2024 16:48:23 +0100 Subject: [PATCH] systemd: network: Add explicit routes towards tundev for UE pool of addresses When running the open5gs package with systemd network config, the 1st IP address of the UE pool configured in open5gs-upfd config file for ogstun is being assigned to the interface through this file. That was discussed as being a desirable default setup. However, in the event a user wants a setup where no IP address is assigned to the tundev, then it's not enough removing the IP address, because then the implicit routing rules regarding the subnet of the IP address added automatically by the kernel are also removed. This patch adds config sections to set up the routing explicitly, with the aim to get the routing still applied if the user decides to comment out the IP address, so that packets are still forwarded properly in that case. Related: https://osmocom.org/issues/6361 --- configs/systemd/99-open5gs.network | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configs/systemd/99-open5gs.network b/configs/systemd/99-open5gs.network index eed7ce116..215eb362f 100644 --- a/configs/systemd/99-open5gs.network +++ b/configs/systemd/99-open5gs.network @@ -5,6 +5,14 @@ Name=ogstun Address=10.45.0.1/16 Address=2001:db8:cafe::1/48 +[Route] +Gateway=0.0.0.0 +Destination=10.45.0.0/16 + +[Route] +Gateway=:: +Destination=2001:db8:cafe::0/48 + [Link] MTUBytes=1400 RequiredForOnline=false