IPsec Routing
Posted: Sun Aug 19, 2018 3:47 am
Have a good stable ipsec tunnel between two sites. Head office is a windows domain and a branch office with domain client computers.
Want branch office domain clients to resolve domain dns queries over tunnel, found this real nice bit of code below but it doesn't work as the branch office router itself cant contact hosts over the tunnel. For example if I try to ping from the branch office router to a host at head office I cant - unless I specify a source ip address in ping command. This stops the code below working.
How can traffic destined for head office subnet from the branch office router itself be routed through the tunnel or is there another way to achieve what I am trying to do?
Want branch office domain clients to resolve domain dns queries over tunnel, found this real nice bit of code below but it doesn't work as the branch office router itself cant contact hosts over the tunnel. For example if I try to ping from the branch office router to a host at head office I cant - unless I specify a source ip address in ping command. This stops the code below working.
How can traffic destined for head office subnet from the branch office router itself be routed through the tunnel or is there another way to achieve what I am trying to do?
Code: Select all
/ip firewall layer7-protocol add name=yourworkplace.com regexp=yourworkplace.com
/ip firewall mangle add chain=prerouting dst-address=192.168.0.1 layer7-protocol=yourworkplace.com action=mark-connection new-connection-mark=yourworkplace.com-forward protocol=tcp dst-port=53
/ip firewall mangle add chain=prerouting dst-address=192.168.0.1 layer7-protocol=yourworkplace.com action=mark-connection new-connection-mark=yourworkplace.com-forward protocol=udp dst-port=53
/ip firewall nat add action=dst-nat chain=dstnat connection-mark=yourworkplace.com-forward to-addresses=10.0.0.4
/ip firewall nat add action=masquerade chain=srcnat connection-mark=yourworkplace.com-forward