2.) network 192.168.0.0/24 (router: 192.168.0.100) vpn-client
config for two openwrt routers with openvpn
#server.ovpn
Code: Select all
port 1194
proto udp
dev tap
ifconfig 10.0.0.2 255.255.255.0
keepalive 10 120
status openvpn-status.log
verb 9
secret /etc/openvpn.key
Code: Select all
dev tap
proto udp
port 1194
remote (ME).dyndns.org
ifconfig 10.0.0.1 255.255.255.0
resolv-retry infinite
nobind
mute-replay-warnings
secret /etc/openvpn.key
verb 9
Code: Select all
iptables -t nat -A prerouting_rule -i $WAN -p udp --dport 1194 -j ACCEPT
iptables -A input_rule -i $WAN -p udp --dport 1194 -j ACCEPT
iptables -I INPUT -i tap+ -p all -j ACCEPT
iptables -I FORWARD -i tap+ -p all -j ACCEPT
iptables -I FORWARD -o tap+ -p all -j ACCEPT
Code: Select all
mask=255.255.255.0
remotegw=10.0.0.2
route add -net 192.168.1.0 netmask $mask gw $remotegw
Code: Select all
mask=255.255.255.0
remotegw=10.0.0.1
route add -net 192.168.0.0 netmask $mask gw $remotegw