Hi everyone,
I’ve encountered the following problem and I need your help to find out how to solve it.
I’ve created a VPN between router A and Router B.
and I wanted to tunnel through router A all internet traffic from the clients behind router B.
and it’s working.
the problem is that the IP address of router A is changing each 10 days (by the ISP)
therefore, each 10 days I have to modify manually the routing table of router B.
why ?
because :
-
on router B there is this routing table:
0.0.0.0 → through router A vpn IP
router A vpn IP → through vpn interface
192.a.b.c → through local interface
10.a.b.c → through wan interface
and …
router A public IP → through 10.0.0.1 ( wan gateway) -
router A has the same dns name even after the IP changes each 10 days. (the dns name is updated)
the problem I identified is when the router A public IP changes, the last routing rule in server B fails.
I think that rule is needed because … in order to establish the VPN the first time, router B needs to solve the name of the router A… ( udp dns 53 query sent to local gateway!!!)
If I remove that, before establishing the vpn, there is no default gw, so the router B cannot solve the name of the vpn server(router A IP) because doesnt have a gw where to send the dns query.
If I put default gateway 0.0.0.0 through local gateway, the traffic is no more tunnelled through router A but is using local gateway ( even with different metric configured)
What can I do to solve this ? Is there a way to use the local gw only for dns queries?
What should be the approach?
Thanks in advance !