By animaexos
Community!
I am curious if it is possible to setup anchor ip gateway as default router so all outbound traffic from droplet shows to external services as coming from floating ip.
This will greatly simplify my external system firewall setup since floating ip never changes; I can allow all connections from floating ip.
I tried adding the anchor ip gateway as the defaultrouter in /etc/rc.conf and reboot but this did not work. (curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/gateway)
I am using freebsd, but welcome any linux recommendations as well. There may be multiple ways to achieve this (e.g. routes, routed, iptables), but what is the CLEANEST approach, and is this even possible on Digital Ocean?
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!
You can also get IP address using this ip addr show eth0 | awk '/inet .*\/16/ {print $2}' | cut -d/ -f 1 without querying API.
To not blocking Digital Ocean’s monitoring agent (do-agent ), exclude the metadata API from the redirect rules:
# iptables -t nat -A POSTROUTING -p tcp -o eth0 ! -d 169.254.169.254 -j SNAT --to-source $ANCHOR_IP
Thanks, this was pretty impressive if you face any problem regarding then head over to 192.168.0.1
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.