I give up, pls help me. - Firewall/routing problem

Need help configuring your VPN? Just post here and you'll get that help.

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

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
guz
OpenVpn Newbie
Posts: 2
Joined: Wed May 11, 2011 1:57 pm

I give up, pls help me. - Firewall/routing problem

Post by guz » Sun May 15, 2011 3:07 pm

Hi, all
It's about three week that I tryed to connect two routers(my home router and a router in the corporate network) with openvpn without success. I can't

figure out how to make it works.
I guess that my issue is routing/firewall misconfiguration.

My goal is seems to be simple, I'd like to connect 2 LAN network, and reach the entire 10.x.x.x class from home.



At the moment ;
router1 can ping router2, and nothing else
lan1 can ping router1,router2 and nothing else
router2 can ping router1, LAN1 and LAN2
LAN2 can ping router2 and nothing else

Configuration:
--------------
Router1(dd-wrt - home router) - openVPNServer
WAN1 DHCP
LAN1 192.168.11.0/24
OpenVPN1 192.168.20.0/24 (ifconfig 192.168.20.1 192.168.20.2)
---------------
cat openvpn.conf

dh /tmp/openvpn/dh.pem
ca /tmp/openvpn/ca.crt
cert /tmp/openvpn/cert.pem
key /tmp/openvpn/key.pem
keepalive 10 120
verb 4
mute 5
log-append /var/log/openvpn
tls-server
management 127.0.0.1 5002
management-log-cache 50
mtu-disc yes
topology subnet
client-config-dir /tmp/openvpn/ccd
script-security 2
port 443
proto tcp-server
cipher aes-256-cbc
auth sha1
ifconfig-pool-persist /tmp/openvpn/ip-pool 86400
comp-lzo yes
client-to-client
tcp-nodelay
tun-mtu 1500
server 192.168.20.0 255.255.255.0
dev tun0
route 10.0.0.0 255.0.0.0 192.168.20.2
verb 6
------------------------
routing table;
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.1 * 255.255.255.255 UH 0 0 0 vlan2
192.168.20.0 * 255.255.255.0 U 0 0 0 tun0
192.168.11.0 * 255.255.255.0 U 0 0 0 br0
192.168.10.0 * 255.255.255.0 U 0 0 0 vlan2
169.254.0.0 * 255.255.0.0 U 0 0 0 br0
10.0.0.0 192.168.20.2 255.0.0.0 UG 0 0 0 tun0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 1.10.168.192.in 0.0.0.0 UG 0 0 0 vlan2
------------------------
Firewall rules
iptables -A INPUT -i tun0 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT


------------------------------------------------------------------------------------
Router2(pfsense 2.0 -corporate router- OpenVPN Client)

WAN2 10.0.127.146/30 gw 10.0.127.145
LAN2 10.0.64.0/25
Openvpn2 192.168.20.2 192.168.20.1
-------------------
cat openvpn.conf

dev ovpnc1
dev-type tun
dev-node /dev/tun1
writepid /var/run/openvpn_client1.pid
#user nobody
#group nobody
script-security 3
daemon
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
proto tcp-client
cipher AES-256-CBC
up /usr/local/sbin/ovpn-linkup
down /usr/local/sbin/ovpn-linkdown
local 10.0.127.146
tls-client
client
lport 0
management /var/etc/openvpn/client1.sock unix
remote c2punti.homeunix.org 443
ifconfig 192.168.20.2 192.168.20.1
http-proxy proxy.intranet.local 80 /var/etc/openvpn/client1.pas basic
route 192.168.11.0 255.255.255.0
ca /var/etc/openvpn/client1.ca
cert /var/etc/openvpn/client1.cert
key /var/etc/openvpn/client1.key
comp-lzo
resolv-retry infinite
--------------------------------
client configuration(client-config-dir /tmp/openvpn/ccd on router1)
iroute 10.0.0.0 255.0.0.0
route 192.168.11.0 255.255.255.0 192.168.20.1
-------------------------------
Routing table; click the following image...
Image


-------------------------------
Firewall rule
pass lan->any destination - any protocol.
pass openvpn from any to any destination - any protocol

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: I give up, pls help me. - Firewall/routing problem

Post by janjust » Sun May 15, 2011 9:26 pm

your mixing a client/server setup with a point-to-point setup. vpnserver1 has
server 192.168.20.0 255.255.255.0
yet the client has
ifconfig 192.168.20.2 192.168.20.1
either convert the server to 'ifconfig 192.168.20.1 192.168.20.2' or make vpnserver2 a full client.

depending on what you choose there are some modifications needed to the route statements as well....

guz
OpenVpn Newbie
Posts: 2
Joined: Wed May 11, 2011 1:57 pm

Re: I give up, pls help me. - Firewall/routing problem

Post by guz » Mon May 16, 2011 1:17 am

Thank's a lot for your answer.
Actually, I need to route traffic between the two subnet as well I need to connect 1 client.
But, if the 2 statements can't coexist, my priority is to route traffic between the 2 subnets.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: I give up, pls help me. - Firewall/routing problem

Post by janjust » Mon May 16, 2011 6:14 am

you can do both, but you will need a client/server setup for this; remove the 'ifconfig' line from the client configuration and connect the client. the client should be assigned the IP address 192.168.20.2.

change the server line
route 10.0.0.0 255.0.0.0 192.168.20.2
to

Code: Select all

route 10.0.0.0 255.0.0.0 192.168.20.1
also, during the debugging phase, comment out 'ifconfig-pool-persist' and 'mtu-disc' as they can sometimes hinder debugging.

Post Reply