Onekey Install: curl -fsSL https://gist.githubusercontent.com/MisakaMikoto-35c5/0e469016745fbf27480c39ae3156f280/raw/install-phantun.sh | sudo bash
Or on OpenWRT: curl -fsSL https://gist.githubusercontent.com/MisakaMikoto-35c5/0e469016745fbf27480c39ae3156f280/raw/install-phantun.sh | sh
Make sure unzip and curl is installed!!!
systemctl start phantun-server@sample-config
systemctl start phantun-client@sample-config
Config files store at /etc/phantun
Please add following lines to /etc/rc.local
nohup /usr/sbin/phantun_client --local 127.114.51.4:8964 --remote 11.4.51.4:1919 --tun-local 169.254.0.0 --tun-peer 169.254.0.1 > /dev/null 2>&1 &
Note: make sure nohup is installed on your system, init.d not implemented.
Use following command to create NAT rules:
firewall-cmd --permanent --zone=external --change-interface=eth0 # Make sure Internet interface in external zone
firewall-cmd --permanent --zone=internal --add-source=169.254.0.0/16 # Make sure tun-local IP address range in internal zone, firewalld will automacially create masquerade NAT rules for internal to external traffic.
firewall-cmd --permanent --zone=external --add-forward-port=port=60001:proto=tcp:toaddr=169.254.0.1:toport=60001 # Create TCP Port forward rule
firewall-cmd --reload # Reload firewall to apply rules
Use following command to create NAT rules:
firewall-cmd --permanent --zone=external --change-interface=eth0 # Make sure Internet interface in external zone
firewall-cmd --permanent --zone=internal --add-source=169.254.0.0/16 # Make sure tun-local IP address range in internal zone, firewalld will automacially create masquerade NAT rules for internal to external traffic.
firewall-cmd --reload # Reload firewall to apply rules