Skip to content

Instantly share code, notes, and snippets.

@hiddify-com
Last active April 26, 2023 09:06
Show Gist options
  • Save hiddify-com/63836c9a158eca29bad6c941610028cf to your computer and use it in GitHub Desktop.
Save hiddify-com/63836c9a158eca29bad6c941610028cf to your computer and use it in GitHub Desktop.
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
@pouyababaie
Copy link

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

Screenshot (40)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment