forked from acouzens/open5gs
changed default ipv6 prefix to 2001:db8:cafe:: (#1321)
to be compliant with RFC3849
This commit is contained in:
parent
ea6675879c
commit
f75e51ca46
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -148,7 +148,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -114,7 +114,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -182,7 +182,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -150,7 +150,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -118,7 +118,7 @@ logger:
|
|||
# o IPv4/IPv6 Pool
|
||||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
#
|
||||
#
|
||||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||
|
@ -127,7 +127,7 @@ logger:
|
|||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# dnn: internet
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# dnn: internet
|
||||
# - addr: 10.46.0.1/16
|
||||
# dnn: ims
|
||||
|
@ -166,10 +166,10 @@ logger:
|
|||
# range:
|
||||
# - 10.45.0.100-10.45.0.200
|
||||
# - 10.45.1.100-10.45.1.200
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# range:
|
||||
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
|
||||
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
|
||||
# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0
|
||||
# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0
|
||||
#
|
||||
# <Domain Name Server>
|
||||
#
|
||||
|
@ -342,7 +342,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
|
|
@ -93,18 +93,18 @@ logger:
|
|||
#
|
||||
# o IPv4/IPv6 Pool
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
#
|
||||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
#
|
||||
#
|
||||
# o Specific DNN/APN(e.g 'ims') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||
# All other APNs use 10.45.0.1/16, 2001:230:cafe::1/48
|
||||
# All other APNs use 10.45.0.1/16, 2001:db8:cafe::1/48
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
|
||||
#
|
||||
# ; If the UE has unknown DNN/APN(not internet/ims), SMF/UPF will crash.
|
||||
|
@ -112,7 +112,7 @@ logger:
|
|||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# dnn: internet
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# dnn: internet
|
||||
# - addr: 10.46.0.1/16
|
||||
# dnn: ims
|
||||
|
@ -131,14 +131,14 @@ logger:
|
|||
#
|
||||
# o Multiple Devices (default: ogstun)
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun2
|
||||
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun2
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun3
|
||||
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun3
|
||||
#
|
||||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# dnn: internet
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# dnn: internet
|
||||
# dev: ogstun2
|
||||
# - addr: 10.46.0.1/16
|
||||
|
@ -155,7 +155,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
#
|
||||
# smf:
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -148,7 +148,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -152,7 +152,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -148,7 +148,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -3,4 +3,4 @@ Name=ogstun
|
|||
|
||||
[Network]
|
||||
Address=10.45.0.1/16
|
||||
Address=2001:230:cafe::1/48
|
||||
Address=2001:db8:cafe::1/48
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -151,7 +151,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -80,7 +80,7 @@ smf:
|
|||
- addr: ::1
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
@ -151,7 +151,7 @@ upf:
|
|||
- addr: 127.0.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
hss:
|
||||
freeDiameter:
|
||||
|
|
|
@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
|
|
|
@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
|
|
|
@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
|
|
|
@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
|
|
|
@ -5,6 +5,6 @@ if ! grep "ogstun" /proc/net/dev > /dev/null; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
|
|
|
@ -343,7 +343,7 @@ upf:
|
|||
+ - addr: 10.11.0.7 # for external gNB - a local address that can be reached by the gNB
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
```
|
||||
|
||||
|
@ -423,7 +423,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
|||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Create the TUN device with the interface name `ogstun`.
|
|||
```bash
|
||||
$ sudo ip tuntap add name ogstun mode tun
|
||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
$ sudo ip link set ogstun up
|
||||
```
|
||||
|
||||
|
@ -148,7 +148,7 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
|||
+ - addr: 10.11.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
```
|
||||
##### 4G EPC
|
||||
|
||||
|
@ -466,7 +466,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
|||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
**Note:** The above assumes you do not have any existing rules in the filter and nat tables. If a program such as docker has already set up rules, you may need to add the Open5GS related rules differently.
|
||||
|
|
|
@ -124,7 +124,7 @@ $ diff -u /etc/open5gs/smf.yaml.old /etc/open5gs/smf.yaml
|
|||
+ - addr: 10.10.0.4
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
@@ -282,7 +281,7 @@
|
||||
#
|
||||
upf:
|
||||
|
@ -217,7 +217,7 @@ $ diff -u /etc/open5gs/upf.yaml.old /etc/open5gs/upf.yaml
|
|||
+ - addr: 10.11.0.7
|
||||
subnet:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
```
|
||||
|
||||
After changing conf files, please restart Open5GS daemons.
|
||||
|
|
|
@ -67,7 +67,7 @@ $ sudo sh -c "cat << EOF > /etc/systemd/network/99-open5gs.network
|
|||
Name=ogstun
|
||||
[Network]
|
||||
Address=10.45.0.1/16
|
||||
Address=2001:230:cafe::1/48
|
||||
Address=2001:db8:cafe::1/48
|
||||
EOF"
|
||||
```
|
||||
|
||||
|
@ -84,7 +84,7 @@ Make sure it is set up properly.
|
|||
$ ifconfig ogstun
|
||||
ogstun: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||
inet 10.45.0.1 netmask 255.255.0.0 destination 10.45.0.1
|
||||
inet6 2001:230:cafe::1 prefixlen 64 scopeid 0x0<global>
|
||||
inet6 2001:db8:cafe::1 prefixlen 64 scopeid 0x0<global>
|
||||
inet6 fe80::e86e:86d8:ea24:f8ee prefixlen 64 scopeid 0x20<link>
|
||||
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
|
|
|
@ -236,7 +236,7 @@ Set the IP address on the `ogstun` TUN interface.
|
|||
|
||||
```bash
|
||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
```
|
||||
|
||||
Make sure it is set up properly.
|
||||
|
|
|
@ -52,7 +52,7 @@ You are now ready to set the IP address on TUN device.
|
|||
|
||||
```bash
|
||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
```
|
||||
|
||||
Make sure it is set up properly.
|
||||
|
|
|
@ -76,7 +76,7 @@ Enable IP forwarding & Masquerading
|
|||
$ sudo sysctl -w net.inet.ip.forwarding=1
|
||||
$ sudo sysctl -w net.inet6.ip6.forwarding=1
|
||||
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
```
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ Enable IP forwarding & Masquerading
|
|||
$ sudo sysctl -w net.inet.ip.forwarding=1
|
||||
$ sudo sysctl -w net.inet6.ip6.forwarding=1
|
||||
$ sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
$ sudo pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
```
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ You are now ready to set the IP address on TUN device.
|
|||
|
||||
```bash
|
||||
$ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
$ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
$ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
```
|
||||
|
||||
Make sure it is set up properly.
|
||||
|
|
|
@ -484,7 +484,7 @@ $ diff -u /etc/systemd/network/99-open5gs.network /etc/systemd/network/99-open5g
|
|||
[Network]
|
||||
-Address=10.45.0.1/16
|
||||
+Address=10.46.0.1/16
|
||||
Address=2001:230:cafe::1/48
|
||||
Address=2001:db8:cafe::1/48
|
||||
```
|
||||
|
||||
Restart systemd-networkd
|
||||
|
@ -509,7 +509,7 @@ $ diff -u smf.yaml smf.yaml.new
|
|||
subnet:
|
||||
- - addr: 10.45.0.1/16
|
||||
+ - addr: 10.46.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
```
|
||||
|
@ -524,7 +524,7 @@ $ diff -u upf.yaml upf.yaml.new
|
|||
subnet:
|
||||
- - addr: 10.45.0.1/16
|
||||
+ - addr: 10.46.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
|
||||
#
|
||||
```
|
||||
|
@ -796,7 +796,7 @@ $ sudo iptables-restore < newtables
|
|||
|
||||
Docker doesn't have IPv6 NAT rules. In this case, you just add the NAT rule as below.
|
||||
```
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
The above operation is the same as described in the following manuals.
|
||||
|
@ -832,7 +832,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
|||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
#### How to use a different DNN/APN for each SMF
|
||||
|
@ -897,23 +897,23 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A
|
|||
#
|
||||
# o IPv4/IPv6 Pool
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
#
|
||||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
#
|
||||
#
|
||||
# o Specific DNN/APN(e.g 'volte') uses 10.46.0.1/16, 2001:230:babe::1/48
|
||||
# All other DNNs/APNs use 10.45.0.1/16, 2001:230:cafe::1/48
|
||||
# All other DNNs/APNs use 10.45.0.1/16, 2001:db8:cafe::1/48
|
||||
# $ sudo ip addr add 10.45.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 10.46.0.1/16 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
# $ sudo ip addr add 2001:230:babe::1/48 dev ogstun
|
||||
#
|
||||
# subnet:
|
||||
# - addr: 10.45.0.1/16
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# - addr: 10.46.0.1/16
|
||||
# dnn: volte
|
||||
# - addr: 2001:230:babe::1/48
|
||||
|
@ -941,10 +941,10 @@ The IP address of the UE can also use a different UE pool depending on the DNN/A
|
|||
# range:
|
||||
# - 10.45.0.100-10.45.0.200
|
||||
# - 10.45.1.100-10.45.1.200
|
||||
# - addr: 2001:230:cafe::1/48
|
||||
# - addr: 2001:db8:cafe::1/48
|
||||
# range:
|
||||
# - 2001:230:cafe:a0::0-2001:230:cafe:b0::0
|
||||
# - 2001:230:cafe:c0::0-2001:230:cafe:d0::0
|
||||
# - 2001:db8:cafe:a0::0-2001:db8:cafe:b0::0
|
||||
# - 2001:db8:cafe:c0::0-2001:db8:cafe:d0::0
|
||||
#
|
||||
```
|
||||
|
||||
|
@ -1125,7 +1125,7 @@ Currently, the number of UE is limited to `128*128`.
|
|||
|
||||
```
|
||||
* IPv4 : 10.45.0.1/16
|
||||
* IPv6 : 2001:230:cafe::1/48
|
||||
* IPv6 : 2001:db8:cafe::1/48
|
||||
```
|
||||
|
||||
- DNS
|
||||
|
|
|
@ -314,7 +314,7 @@ $ sudo sysctl -w net.ipv6.conf.all.forwarding=1
|
|||
|
||||
### Add NAT Rule
|
||||
$ sudo iptables -t nat -A POSTROUTING -s 10.45.0.0/16 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:230:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
$ sudo ip6tables -t nat -A POSTROUTING -s 2001:db8:cafe::/48 ! -o ogstun -j MASQUERADE
|
||||
```
|
||||
|
||||
**Note:** For the first time, it is a good condition if you do not have any rules in the IP/NAT tables. If a program such as docker has already set up a rule, you will need to add a rule differently.
|
||||
|
|
|
@ -79,7 +79,7 @@ pgw:
|
|||
- addr: ::1
|
||||
ue_pool:
|
||||
- addr: 10.45.0.1/16
|
||||
- addr: 2001:230:cafe::1/48
|
||||
- addr: 2001:db8:cafe::1/48
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 8.8.4.4
|
||||
|
|
|
@ -379,7 +379,7 @@ int ogs_gtp_context_parse_config(const char *local, const char *remote)
|
|||
/* Find first IPv4/IPv6 address in the list.
|
||||
*
|
||||
* In the following configuration,
|
||||
* 127.0.0.4, 127.0.0.5 and 2001:230:cafe::1 are ignored
|
||||
* 127.0.0.4, 127.0.0.5 and 2001:db8:cafe::1 are ignored
|
||||
* on PFCP Assocation Response message's
|
||||
* user plane IP resource information.
|
||||
*
|
||||
|
@ -389,7 +389,7 @@ int ogs_gtp_context_parse_config(const char *local, const char *remote)
|
|||
* - ::1
|
||||
* - 127.0.0.4
|
||||
* - 127.0.0.5
|
||||
* - 2001:230:cafe::1
|
||||
* - 2001:db8:cafe::1
|
||||
*
|
||||
* To include all user plane IP resource information,
|
||||
* configure as below:
|
||||
|
@ -401,7 +401,7 @@ int ogs_gtp_context_parse_config(const char *local, const char *remote)
|
|||
* - addr: 127.0.0.4
|
||||
* - addr
|
||||
* - 127.0.0.5
|
||||
* - 2001:230:cafe::1
|
||||
* - 2001:db8:cafe::1
|
||||
*/
|
||||
node = ogs_list_first(&list);
|
||||
node6 = ogs_list_first(&list6);
|
||||
|
|
|
@ -315,8 +315,8 @@ typedef struct ogs_pfcp_dev_s {
|
|||
typedef struct ogs_pfcp_subnet_s {
|
||||
ogs_lnode_t lnode;
|
||||
|
||||
ogs_ipsubnet_t sub; /* Subnet : 2001:230:cafe::0/48 */
|
||||
ogs_ipsubnet_t gw; /* Gateway : 2001:230:cafe::1 */
|
||||
ogs_ipsubnet_t sub; /* Subnet : 2001:db8:cafe::0/48 */
|
||||
ogs_ipsubnet_t gw; /* Gateway : 2001:db8:cafe::1 */
|
||||
char dnn[OGS_MAX_DNN_LEN+1]; /* DNN : "internet", "volte", .. */
|
||||
|
||||
#define OGS_MAX_NUM_OF_SUBNET_RANGE 16
|
||||
|
|
|
@ -8,8 +8,8 @@ if [ "$SYSTEM" = "Linux" ]; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
ip addr del fd69:f21d:873c:fa::1 dev lo 2> /dev/null
|
||||
ip addr del fd69:f21d:873c:fa::2 dev lo 2> /dev/null
|
||||
|
@ -120,7 +120,7 @@ else
|
|||
if [ "$SYSTEM" = "Darwin" ]; then
|
||||
if ! test -f /etc/pf.anchors/org.open5gs; then
|
||||
sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
fi
|
||||
pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
fi
|
||||
|
|
|
@ -12,8 +12,8 @@ if [ "$SYSTEM" = "Linux" ]; then
|
|||
fi
|
||||
ip addr del 10.45.0.1/16 dev ogstun 2> /dev/null
|
||||
ip addr add 10.45.0.1/16 dev ogstun
|
||||
ip addr del 2001:230:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:230:cafe::1/48 dev ogstun
|
||||
ip addr del 2001:db8:cafe::1/48 dev ogstun 2> /dev/null
|
||||
ip addr add 2001:db8:cafe::1/48 dev ogstun
|
||||
ip link set ogstun up
|
||||
else
|
||||
sysctl -w net.inet.ip.forwarding=1
|
||||
|
@ -40,7 +40,7 @@ else
|
|||
if [ "$SYSTEM" = "Darwin" ]; then
|
||||
if ! test -f /etc/pf.anchors/org.open5gs; then
|
||||
sudo sh -c "echo 'nat on {en0} from 10.45.0.0/16 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
sudo sh -c "echo 'nat on {en0} from 2001:230:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
sudo sh -c "echo 'nat on {en0} from 2001:db8:cafe::1/48 to any -> {en0}' > /etc/pf.anchors/org.open5gs"
|
||||
fi
|
||||
pfctl -e -f /etc/pf.anchors/org.open5gs
|
||||
fi
|
||||
|
|
|
@ -34,7 +34,7 @@ extern "C" {
|
|||
#define TEST_GNB_IPV4 TEST_ENB_IPV4
|
||||
|
||||
#define TEST_PING_IPV4 "10.45.0.1"
|
||||
#define TEST_PING_IPV6 "2001:230:cafe::1"
|
||||
#define TEST_PING_IPV6 "2001:db8:cafe::1"
|
||||
|
||||
#define MAX_NUM_OF_SERVED_GUAMI 8
|
||||
|
||||
|
|
|
@ -459,7 +459,7 @@ ogs_pkbuf_t *testesm_build_bearer_resource_modification_request(
|
|||
tft.pf[0].identifier = 4;
|
||||
tft.pf[0].precedence = 0x0f;
|
||||
|
||||
rv = ogs_ipsubnet(&ipsubnet, "2001:230:cafe::9", "120");
|
||||
rv = ogs_ipsubnet(&ipsubnet, "2001:db8:cafe::9", "120");
|
||||
ogs_assert(rv == OGS_OK);
|
||||
#if 1
|
||||
tft.pf[0].content.length = 18;
|
||||
|
|
|
@ -150,7 +150,7 @@ ogs_pkbuf_t *testgsm_build_pdu_session_modification_request(
|
|||
qos_rule[0].pf[0].content.component[0].type =
|
||||
OGS_PACKET_FILTER_IPV6_LOCAL_ADDRESS_PREFIX_LENGTH_TYPE;
|
||||
|
||||
rv = ogs_ipsubnet(&ipsubnet, "2001:230:cafe::9", "120");
|
||||
rv = ogs_ipsubnet(&ipsubnet, "2001:db8:cafe::9", "120");
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
memcpy(qos_rule[0].pf[0].content.component[0].ipv6.addr,
|
||||
|
|
|
@ -417,13 +417,13 @@ static void test8_func(abts_case *tc, void *data)
|
|||
rv = ogs_ipsubnet(&ipsub, "172.16.0.1", "16");
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_ipsubnet(&ipsub, "2001:230:cafe::1", "64");
|
||||
rv = ogs_ipsubnet(&ipsub, "2001:db8:cafe::1", "64");
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_ipsubnet(&ipsub, "172.16.0.1", NULL);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
rv = ogs_ipsubnet(&ipsub, "2001:230:cafe::1", NULL);
|
||||
rv = ogs_ipsubnet(&ipsub, "2001:db8:cafe::1", NULL);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue