Skip to content

Commit 2cec115

Browse files
authored
Merge branch 'main' into feat/cnti-best-practice
2 parents 2760f0a + 3f8c6a7 commit 2cec115

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
@@ -63,6 +63,12 @@ data:
6363
# Setup iptables for NAT via dedicated interfaces
6464
iptables -A FORWARD -j ACCEPT
6565
iptables -t nat -A POSTROUTING -s {{ $.Values.global.uesubnet }} -o n6 -j MASQUERADE # route traffic comming from the UE SUBNET to the interface N6
66+
67+
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
68+
if [ ! -f /etc/iproute2/rt_tables ]; then
69+
cp /usr/share/iproute2/rt_tables /etc/iproute2/rt_tables
70+
fi
71+
6672
echo "1200 n6if" >> /etc/iproute2/rt_tables # create a routing table for the interface N6
6773
ip rule add from {{ $.Values.global.uesubnet }} table n6if # use the created ip table to route the traffic comming from the UE SUBNET
6874
ip route add default via {{ $.Values.global.upf.multus.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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ data:
6363
# Setup iptables for NAT via dedicated interfaces
6464
iptables -A FORWARD -j ACCEPT
6565
iptables -t nat -A POSTROUTING -s {{ $.Values.global.uesubnet }} -o n6 -j MASQUERADE # route traffic comming from the UE SUBNET to the interface N6
66+
67+
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
68+
if [ ! -f /etc/iproute2/rt_tables ]; then
69+
cp /usr/share/iproute2/rt_tables /etc/iproute2/rt_tables
70+
fi
71+
6672
echo "1200 n6if" >> /etc/iproute2/rt_tables # create a routing table for the interface N6
6773
ip rule add from {{ $.Values.global.uesubnet }} table n6if # use the created ip table to route the traffic comming from the UE SUBNET
6874
ip route add default via {{ $.Values.global.upf.multus.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

0 commit comments

Comments
 (0)