Unix & Linux Asked by Perimosh on February 5, 2021
This is my route output (part of it):
I have a private IP I need to access while I’m under a VPN. The IP starts with 172.17…. By removing the docker0 entry, I have access to my private IP. But, every time I restart my laptop, the docker0 entry gets added back.
Can I change the order of the route table so that way the rule with 228.1 at the end gets resolved first? Event though this may be a short term solution, it would help me a lot.
You have two unrelated uses (1=docker, 2=VPN) of the same subnet (172.17.0.0) in the same network namespace. This will certainly cause problems for one of the two.
The docker setup has priority over the VPN setup because the docker route has a lower metric. The metric is the 5th column of your output from the route command (docker=0, VPN=50). The lower the metric number, the higher the priority (see the man page for ip-route and look for metric or preference).
You can try to find out where your two routes (docker and VPN) are setup and try to fix the metric. We would need to know more about your setup to help you find where the routes are setup (e.g. linux distribution and version, how is docker installed, what VPN package is installed, etc). However, I would assume that if you give your VPN route a better priority then your docker setup will not work. Which maybe in your case is OK (i.e. maybe you don't even use the docker setup but happen to have it installed). If it's the case that you have docker installed but don't even need it, then it might be just as easy to uninstall docker than it is to change metric parameters.
Basically, for any relatively easy solution, one of the two setups (docker or VPN) will have to have priority at boot up and you'll have to manually modify something (like you are doing now by deleting docker0 route from the routing table) to access the other setup.
Answered by DericS on February 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP