Конфиг сервера:
port 1194
proto udp
dev tap
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
key /etc/openvpn/easy-rsa/2.0/keys/server.key
dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem
ifconfig-pool-persist /etc/openvpn/ipp.txt
server-bridge 192.168.2.2 255.255.255.0 192.168.2.224 192.168.2.254
push "redirect-gateway def1 bypass-dhcp"
script-security 2
up /etc/openvpn/scripts/up.sh
learn-address /etc/openvpn/scripts/routes.sh
client-to-client
duplicate-cn
keepalive 10 60
comp-lzo
persist-key
persist-tun
verb 3
up.sh
/usr/sbin/sysctl -w net.link.ether.inet.proxyall=1
/usr/sbin/sysctl -w net.inet.ip.forwarding=1
/sbin/ifconfig bridge0 addm tap0
routes.sh Пока пустой
Конфиг клиента:
client
dev tap
proto udp
remote 65.105.72.140 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
comp-lzo
verb 3
Лог
Sun Jul 13 01:43:49 2014 C:\WINDOWS\system32\route.exe ADD 65.105.72.140 MASK 255.255.255.255 192.168.1.1
Sun Jul 13 01:43:49 2014 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=20 and dwForwardType=4
Sun Jul 13 01:43:49 2014 Route addition via IPAPI succeeded [adaptive]
Sun Jul 13 01:43:49 2014 C:\WINDOWS\system32\route.exe ADD 0.0.0.0 MASK 128.0.0.0 192.168.2.2
Sun Jul 13 01:43:49 2014 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Sun Jul 13 01:43:49 2014 Route addition via IPAPI succeeded [adaptive]
Sun Jul 13 01:43:49 2014 C:\WINDOWS\system32\route.exe ADD 128.0.0.0 MASK 128.0.0.0 192.168.2.2
Sun Jul 13 01:43:49 2014 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=30 and dwForwardType=4
Sun Jul 13 01:43:49 2014 Route addition via IPAPI succeeded [adaptive]
Sun Jul 13 01:43:49 2014 Initialization Sequence Completed
Соединение OpenVPN (GUI) у Windows 7 происходит без проблем, а вот в Интернет через сервер ходить не хочет!
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether a8:13:11:1c:7b:a1
inet 65.105.72.140 netmask 0xfffffc00 broadcast 65.105.75.255
inet 65.105.75.185 netmask 0xfffffc00 broadcast 65.105.75.255
inet 192.168.2.2 netmask 0xfffffc00 broadcast 192.168.3.255
media: autoselect (100baseTX <full-duplex,flow-control>)
status: active
-
-
-
-
-
-
bridge0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether ab:30:33:a1:09:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
member: tap0 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 10 priority 0 path cost 0
media: <unknown type>
status: inactive
tap0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0f:f6:79:93:9a:1c
open (pid 26491)
netstat -ran
Destination Gateway Flags Refs Use Netif Expire
default 65.105.72.1 UGSc 48 0 en0
5.255.253.147 65.105.72.1 UGHWIi 1 44 en0
23.43.133.163 65.105.72.1 UGHWIi 1 6 en0
37.46.242.108 65.105.72.1 UGHW3I 0 17 en0 3368
37.58.100.91 65.105.72.1 UGHW3I 0 3 en0 3260
37.58.100.140 65.105.72.1 UGHW3I 0 14 en0 3401
37.58.100.148 65.105.72.1 UGHW3I 0 6 en0 3289
37.58.100.154 65.105.72.1 UGHW3I 0 15 en0 3460
61.174.51.219 65.105.72.1 UGHWIi 3 89 en0
66.249.65.107 65.105.72.1 UGHW3I 0 36 en0 3461
66.249.67.33 65.105.72.1 UGHW3I 0 42 en0 3550
66.249.67.46 65.105.72.1 UGHW3I 0 53 en0 3368
66.249.67.59 65.105.72.1 UGHW3I 0 66 en0 3582
66.249.67.107 65.105.72.1 UGHW3I 0 56 en0 3434
74.82.47.25 65.105.72.1 UGHW3I 0 1 en0 3499
94.250.234.118 65.105.72.1 UGHW3I 0 6 en0 3256
95.211.37.197 65.105.72.1 UGHW3I 0 7 en0 3289
101.226.166.196 65.105.72.1 UGHW3I 0 20 en0 3374
101.226.166.204 65.105.72.1 UGHW3I 0 4 en0 3260
101.226.166.205 65.105.72.1 UGHW3I 0 12 en0 3379
101.226.166.206 65.105.72.1 UGHW3I 0 7 en0 3312
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 8 10706 lo0
169.254 link#4 UCS 0 0 en0
180.76.5.71 65.105.72.1 UGHW3I 0 16 en0 3502
180.76.6.133 65.105.72.1 UGHW3I 0 16 en0 3325
182.118.20.224 65.105.72.1 UGHW3I 0 88 en0 3566
182.118.20.225 65.105.72.1 UGHW3I 0 70 en0 3558
182.118.20.227 65.105.72.1 UGHW3I 0 17 en0 3545
185.56.80.133 65.105.72.1 UGHW3I 0 7 en0 3423
185.56.80.137 65.105.72.1 UGHW3I 0 14 en0 3578
192.168.1.35 65.105.72.1 UGHW3I 0 1 en0 3502
192.227.245.117 65.105.72.1 UGHW3I 0 2 en0 3495
202.66.32.116 65.105.72.1 UGHW3I 0 1 en0 3377
208.115.113.85 65.105.72.1 UGHW3I 0 6 en0 3289
212.30.134.167 65.105.72.1 UGHW3I 0 9 en0 3582
212.30.134.174 65.105.72.1 UGHW3I 0 8 en0 3589
217.195.49.131 65.105.72.1 UGHWIi 1 46 en0
224.0.0.251 65.105.72.1 UGHmW3I 0 0 en0 3549
Естественно при соединении ничего из 192.168.2.0 не пингуется, кроме самого клиента