We assume that a VPN connection is already setup and a ppp0
interface is up and running.
Run following commands as root
user:
cd /etc/iproute2
cp rt_tables rt_tables.orig
echo "1 vpn" >> /etc/iproute2/rt_tables
ip route add default dev ppp0 table vpn
ip rule add to 44.205.64.0/24 table vpn #Docker
ip rule add to 34.205.13.0/24 table vpn # Docker
ip rule add to 3.216.34.0/24 table vpn # Docker
ip rule add to 138.197.224.240 table vpn # dist.libuv.org
Top 3 IP ranges of the above examples are for Docker
to pull images through VPN connection. Docker Hub
is hosted on AWS therefore these IPs might change frequently.
- Please note that these changes are not persistent and will be lost upon system reboot.