Difference between revisions of "Open5gs: NAT port forwarding"
Jump to navigation
Jump to search
(Created page with " sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE sudo systemctl stop ufw sudo iptables -I FORWARD 1 -j ACCEPT # if above s...") |
Onnowpurbo (talk | contribs) |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | Berikut ini adalah untuk melakukan port forwarding agar UE mendapatkan internet dari Open5gs | ||
+ | |||
sudo sysctl -w net.ipv4.ip_forward=1 | sudo sysctl -w net.ipv4.ip_forward=1 | ||
sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE | sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE | ||
Line 4: | Line 6: | ||
sudo iptables -I FORWARD 1 -j ACCEPT | sudo iptables -I FORWARD 1 -j ACCEPT | ||
− | + | Jika cara diatas tidak berhasil, coba tambahkan manual tun interface dan lakukan nat forwarding ulang | |
+ | |||
sudo ip tuntap add name ogstun mode tun | sudo ip tuntap add name ogstun mode tun | ||
sudo ip addr add 10.45.0.0/16 dev ogstun | sudo ip addr add 10.45.0.0/16 dev ogstun | ||
sudo ip addr add 2001:230:cafe::1/48 dev ogstun | sudo ip addr add 2001:230:cafe::1/48 dev ogstun | ||
sudo ip link set ogstun up | sudo ip link set ogstun up | ||
+ | |||
+ | Catatan: NAT forwarding dilakukan kembali apabila core network open5gs di restart | ||
+ | |||
+ | |||
+ | ==Pranala Menarik== | ||
+ | |||
+ | * [[5G]] |
Latest revision as of 13:49, 22 December 2022
Berikut ini adalah untuk melakukan port forwarding agar UE mendapatkan internet dari Open5gs
sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o ens18 -j MASQUERADE sudo systemctl stop ufw sudo iptables -I FORWARD 1 -j ACCEPT
Jika cara diatas tidak berhasil, coba tambahkan manual tun interface dan lakukan nat forwarding ulang
sudo ip tuntap add name ogstun mode tun sudo ip addr add 10.45.0.0/16 dev ogstun sudo ip addr add 2001:230:cafe::1/48 dev ogstun sudo ip link set ogstun up
Catatan: NAT forwarding dilakukan kembali apabila core network open5gs di restart