By umakot
I have 2 droplets. Lets say FWserver and APPserver. I want to make sure that all inbound and outbound traffic in my private networking is going via FWserver. on FWserver,eth0 is connected to internet (ip 139.59.x.x) and eth1 is connected internally to private network (10.139.y.y).
on FWserver, I did the following echo 1 > /proc/sys/net/ipv4/ip_forward route add -net 10.0.0.0./16 dev eth0 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
From APPserver
I am able to ping and connect to private networking ip 10.139.y.y However I am unable to reach the public ip 139.59.x.x
I guess that is the first step before I can connect to internet from APPserver via FWsever
Please help. this is urgent for me to setup my private networking
thanks UK
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!
first step is to make FWserver forwarding persistent
echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
sysctl -p
second is to make sure all iptables rules are in the rule base
iptables -A PREROUTING -d 139.59.x.x -p tcp -j DNAT --to-destination 10.139.y.y
then your masquerade rule
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
with those rules you should be able to ping default gateway from your 10.139.y.y address, if the APPserver nics are configured correctly to interface with the eth1 on FWserver.
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.