Skip to content

Commit 3f8c6a7

Browse files
authored
Merge pull request #24 from KASHZKX/fix/upf-22-wrapper-sh-fails-on-debian-13
fix: wrapper.sh fails on Debian 13
2 parents 9246b50 + 0064c81 commit 3f8c6a7

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

charts/free5gc/charts/free5gc-upf/templates/psaupf1/psaupf1-configmap.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ data:
4848
### Implement networking rules
4949
iptables -A FORWARD -j ACCEPT
5050
iptables -t nat -A POSTROUTING -s {{ $.Values.global.uesubnet }} -o n6 -j MASQUERADE # route traffic comming from the UE SUBNET to the interface N6
51+
52+
mkdir -p /etc/iproute2 # Debian 13 (trixie) ships the default table mappings at /usr/share/iproute2/rt_tables, but the UPF needs it at /etc/iproute2/rt_tables, so we need to copy it if it doesn't exist
53+
if [ ! -f /etc/iproute2/rt_tables ]; then
54+
cp /usr/share/iproute2/rt_tables /etc/iproute2/rt_tables
55+
fi
56+
5157
echo "1200 n6if" >> /etc/iproute2/rt_tables # create a routing table for the interface N6
5258
ip rule add from {{ $.Values.global.uesubnet }} table n6if # use the created ip table to route the traffic comming from the UE SUBNET
5359
ip route add default via {{ $.Values.global.n6network.gatewayIP }} dev n6 table n6if # add a default route in the created table so that all UEs will use this gateway for external communications (target IP not in the Data Network attached to the interface N6) and then the Data Network will manage to route the traffic

charts/free5gc/charts/free5gc-upf/templates/psaupf2/psaupf2-configmap.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ data:
4848
### Implement networking rules
4949
iptables -A FORWARD -j ACCEPT
5050
iptables -t nat -A POSTROUTING -s {{ $.Values.global.uesubnet }} -o n6 -j MASQUERADE # route traffic comming from the UE SUBNET to the interface N6
51+
52+
mkdir -p /etc/iproute2 # Debian 13 (trixie) ships the default table mappings at /usr/share/iproute2/rt_tables, but the UPF needs it at /etc/iproute2/rt_tables, so we need to copy it if it doesn't exist
53+
if [ ! -f /etc/iproute2/rt_tables ]; then
54+
cp /usr/share/iproute2/rt_tables /etc/iproute2/rt_tables
55+
fi
56+
5157
echo "1200 n6if" >> /etc/iproute2/rt_tables # create a routing table for the interface N6
5258
ip rule add from {{ $.Values.global.uesubnet }} table n6if # use the created ip table to route the traffic comming from the UE SUBNET
5359
ip route add default via {{ $.Values.global.n6network.gatewayIP }} dev n6 table n6if # add a default route in the created table so that all UEs will use this gateway for external communications (target IP not in the Data Network attached to the interface N6) and then the Data Network will manage to route the traffic

0 commit comments

Comments
 (0)