coisa realmente boba ...
é necessário que haja um retorno de carro no final dos arquivos hostname.tun0 e bridgename.bridge0.
Estou tentando configurar o openvpn no modo bridge. Eu fiz isso antes em um roteador openbsd. Agora eu tenho uma máquina interna que está executando o openbsd. o cliente é um laptop do windows 7.
As configurações são as seguintes.
Minha lan local em casa é 10.0.10.0 255.255.255.0 com um gateway de 10.0.10.1 O servidor vpn é 10.0.10.15
Estou encaminhando a porta 9999 udp pública para 10.0.10.15.
no servidor: /etc/hostname.tun0
link0 up
/etc/bridgename.bridge0
add pcn0
add tun0
up
/etc/openvpn.conf
dev-type tap
dev tun0
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
user nobody
group nobody
daemon openvpn
chroot /var/empty
port 9999
proto udp
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem
management 127.0.0.1 9998 /etc/openvpn/mgmt.pwd
server-bridge 10.0.10.1 255.255.255.0 10.0.10.240 10.0.10.244
push "route 10.0.10.0 255.255.255.0"
ifconfig-pool-persist ipp.txt
client-to-client
tls-auth /etc/openvpn/keys/ta.key 0
cipher AES-256-CBC
max-clients 5
status openvpn-status.log
log-append openvpn.log
verb 4
mute 20
no cliente: openvpn.conf:
client
remote xxx.xxx.xxx.xxx 9999 #my ip is really here
proto udp
dev tap
dev-node VPN
nobind
comp-lzo
link-mtu 1590
persist-key
persist-tun
keepalive 10 120
management 127.0.0.1 9090 "mgmt.pwd"
ns-cert-type server
ca "ca.crt"
cert "tim-work-laptop.crt"
key "tim-work-laptop.key"
tls-client
tls-auth "ta.key" 1
cipher AES-256-CBC
pull
verb 2
quando executo um ifconfig -a no servidor:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33204
priority: 0
groups: lo
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
pcn0: flags=8b43<UP,BROADCAST,RUNNING,PROMISC,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
lladdr 08:00:27:04:df:8c
priority: 0
groups: egress
media: Ethernet none
status: active
inet6 fe80::a00:27ff:fe04:df8c%pcn0 prefixlen 64 scopeid 0x1
inet 10.0.10.15 netmask 0xffffff00 broadcast 10.0.10.255
enc0: flags=0<> mtu 1536
priority: 0
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
priority: 0
groups: tun
bridge0: flags=0<> mtu 1500
priority: 0
groups: bridge
pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33204
priority: 0
groups: pflog
minha configuração de firewall está aberta porque é uma caixa interna:
int_if="pcn0"
vpn_if="tun0"
br_if="bridge0"
vpn="9999"
ntp="123"
dns="53"
#set require-order no
set skip on lo
scrub in
pass in proto udp from any to any port $ntp
pass in proto {tcp,udp} from any to any port $dns
pass in # to establish keep-state
#vpn/bridge info
pass in quick on $int_if proto udp from any to $int_if port $vpn
pass in quick on {$vpn_if,$br_if} proto {tcp,udp,icmp} from any to any
pass out quick on {$vpn_if,$br_if} proto {tcp,udp,icmp} from any to any
O cliente windows se conecta, me dá um ip de 10.0.10.240 como esperado, e o ícone de gui openvpn é verde. No entanto, não consigo pingar nada na minha lan local em casa, inclua 10.0.10.15.
Alguma idéia?