openwrt openvpn simple server-to-server configuration

This is the forum to post your config. Include diagrams, usage graphs, and all the other goodies to show off your network.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
TomBombadil13
OpenVpn Newbie
Posts: 1
Joined: Fri Oct 30, 2009 5:48 pm

openwrt openvpn simple server-to-server configuration

Post by TomBombadil13 » Fri Oct 30, 2009 6:29 pm

1.) network 192.168.1.0/24 (router: 192.168.1.200) vpn-server
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
#client.ovpn

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 
#add to client and server /etc/firewall.user

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
#client route

Code: Select all

mask=255.255.255.0
remotegw=10.0.0.2
route add -net 192.168.1.0 netmask $mask gw $remotegw
#server route

Code: Select all

mask=255.255.255.0
remotegw=10.0.0.1
route add -net 192.168.0.0 netmask $mask gw $remotegw

User avatar
krzee
Forum Team
Posts: 728
Joined: Fri Aug 29, 2008 5:42 pm

Re: openwrt openvpn simple server-to-server configuration

Post by krzee » Wed Mar 10, 2010 5:53 am

This is a point to point setup, there is no server or client.

Post Reply