Skip to content

Commit

Permalink
Add iptables startup configuration for UPF
Browse files Browse the repository at this point in the history
  • Loading branch information
abousselmi committed Dec 14, 2021
1 parent 0d876de commit 4fac16e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 7 additions & 0 deletions config/upf-iptables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#
# Configure iptables in UPF
#
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -I FORWARD 1 -j ACCEPT

2 changes: 1 addition & 1 deletion config/upfcfg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ configuration:
- addr: upf.free5gc.org

gtpu:
- addr: 0.0.0.0
- addr: upf.free5gc.org
# [optional] gtpu.name
# - name: upf.5gc.nctu.me
# [optional] gtpu.ifname
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ services:
context: ./nf_upf
args:
DEBUG_TOOLS: "false"
command: ./free5gc-upfd -f ../config/upfcfg.yaml
command: bash -c "./upf-iptables.sh && ./free5gc-upfd -f ../config/upfcfg.yaml"
volumes:
- "./config/upfcfg.yaml:/free5gc/config/upfcfg.yaml"
- ./config/upfcfg.yaml:/free5gc/config/upfcfg.yaml
- ./config/upf-iptables.sh:/free5gc/free5gc-upfd/upf-iptables.sh
cap_add:
- NET_ADMIN
networks:
Expand Down

0 comments on commit 4fac16e

Please sign in to comment.