Hello,
sorry for my late reply, Christmas time was a bit hectic :( Thanks again and you were right again. There was a policy based routing rule I didnt thinkt about, something like this:
iptables -t mangle -A PREROUTING -s 10.0.0.0/24 -j MARK –set-mark 2
And I set anoher one which solved the issue:
iptables -t mangle -A PREROUTING -d 192.168.1.0/24 -j MARK --set-mark 1
But now I have nother problem :/ I read myself into why I should use tun instead of tap and not bridging, because like you said it would produce lots of broadcast traffic for example. So I changed my server config to this:
config 'openvpn' 'lan'
option 'enable' '1'
option 'port' '1194'
option 'proto' 'udp'
option 'dev' 'tun2'
option 'ca' '/etc/easy-rsa/keys/ca.crt'
option 'cert' '/etc/easy-rsa/keys/server.crt'
option 'key' '/etc/easy-rsa/keys/server.key'
option 'dh' '/etc/easy-rsa/keys/dh2048.pem'
#option 'ifconfig_pool_persist' '/tmp/ipp.txt'
#option 'ifconfig-pool' '10.8.0.2 10.8.0.10 255.255.255.0'
option 'keepalive' '10 120'
option 'comp_lzo' '0'
option 'persist_key' '1'
option 'persist_tun' '1'
option 'status' '/tmp/openvpn-status.log'
option 'verb' '3'
#option 'server_bridge' '192.168.1.1 255.255.255.0 192.168.1.200 192.168.1.205'
option server "10.8.0.0 255.255.255.0"
list push "route 192.168.1.0 255.255.255.0"
But again I cant get it to work, and it's even worse now than before with the bridging, where in the end I got it to work.
First confusing thing is that it shows this on the client:
tun2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.6 P-t-P:10.8.0.5 Mask:255.255.255.255
And on the server:
tun2 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
Why two adresses for each? and why does the client get 6 (and 5?) and not 2? Also I cant even ping from side to side from the client to the server. My routing table looks a little bit weird too:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.1.1 0.0.0.0 UG 0 0 0 eth1
10.0.0.0 * 255.255.255.0 U 0 0 0 br-lan
10.0.1.0 * 255.255.255.0 U 0 0 0 eth1
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun2
10.8.0.5 * 255.255.255.255 UH 0 0 0 tun2
172.20.16.0 * 255.255.248.0 U 0 0 0 tun0
172.20.24.0 * 255.255.248.0 U 0 0 0 tun1
192.168.1.0 10.8.0.5 255.255.255.0 UG 0 0 0 tun2
And on the server:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 188-194-- 0.0.0.0 UG 0 0 0 eth1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun2
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun2
172.20.24.0 * 255.255.248.0 U 0 0 0 tun1
172.20.24.0 * 255.255.248.0 U 0 0 0 tun0
188.194.*.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 br-lan