By Carl
Hello, I happened to accidentally remove my old iptables for forwarding port 80 and 443 to another droplet on the private DO network. After googling now for a few hours I have to say I really can’t find anything related to it. From what I remember I read a tutorial here but as said I can’t find it. Maybe someone could tell me how to do it or link me to the tutorial (if it still exists).
Many thanks, Carl
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Okay so apparently I had the same script on another server (for whatever reason. Well I won’t complain…)
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 10.132.112.54:443
iptables -t nat -A POSTROUTING -p tcp -d 10.132.112.54 --dport 443 -j SNAT --to-source 10.132.113.5
The same for port 80 and so on…
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.