Two LAN - LAN1 and LAN2 - at two locations are connected via openvpn-bridging, they are on the same subnet. The routing table looks like this
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
bc:5f:f4:3d:3b:8b,LAN2,12.34.56.78:1194,Mon Oct 19 08:58:49 2015
00:13:45:78:12:c4,LAN2,12.34.56.78:1194,Sun Oct 18 14:51:31 2015
00:20:6a:54:6e:d7,LAN2,12.34.56.78:1194,Mon Oct 19 08:59:44 2015
00:08:5d:8a:72:8c,LAN2,12.34.56.78:1194,Mon Oct 19 08:59:22 2015
00:0e:0c:4a:53:df,LAN2,12.34.56.78:1194,Mon Oct 19 08:59:43 2015
GLOBAL STATS
Max bcast/mcast queue length,7
END
It frequently occurs that one of the computers switches the location, they go from LAN2 to LAN1. When this happens the routing table isn't updated, so that openvpn "thinks" that this computer is still in the LAN2 when it is actually in LAN1. As a result this computer can't connect servers in LAN2 anymore.
The only solution is to terminate openvpn and start it again, so that the openvpn learns all mac addresses from the start and rebuilds its routing table.
Is there a way to delete a single learned mac adress? Or is there a config switch that makes openvpn to "forget" a learned mac address after a period of time?
Below are my configs
From the gateway at LAN1
server-bridge 192.168.0.1 255.255.252.0 192.168.3.220 192.168.3.229
proto udp
dev tap0
ca /etc/ssl/keys/ca.crt
cert /etc/ssl/keys/server.crt
key /etc/ssl/keys/server.key
dh /etc/ssl/keys/dh1024.pem
crl-verify /etc/ssl/keys/crl.pem
mssfix 1200
fragment 1200
client-to-client
ping-timer-rem
keepalive 20 180
push "dhcp-option DNS 192.168.1.12"
verb 3
mute 50
From the gateway at LAN2
tls-client
remote 23.45.67.89
proto udp
dev tap0
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/LAN2.crt
key /etc/openvpn/LAN2.key
ns-cert-type server
mssfix 1200
fragment 1200
verb 3
mute 50