Last active
April 26, 2023 09:06
-
-
Save hiddify-com/63836c9a158eca29bad6c941610028cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -p 'Enter your main server IP like(1.1.1.1): ' IP | |
echo "The main server IP is $IP" | |
sudo apt install iptables iptables-persistent | |
sudo sysctl net.ipv4.ip_forward=1 | |
sudo iptables -t nat -A POSTROUTING -p tcp --match multiport --dports 80,443 -j MASQUERADE | |
sudo iptables -t nat -A PREROUTING -p tcp --match multiport --dports 80,443 -j DNAT --to-destination $IP | |
sudo iptables -t nat -A POSTROUTING -p udp -j MASQUERADE | |
sudo iptables -t nat -A PREROUTING -p udp -j DNAT --to-destination $IP | |
sudo mkdir -p /etc/iptables/ | |
sudo iptables-save | sudo tee /etc/iptables/rules.v4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran this command in my bridge server but when I want to go to my panel via the relay domain I declared in panel, the panel couldn't resolve.
Here is an image for demonstration