HI all
following instructions at the very top of this forum:
Goal: to build a "clustered" VPN server, i.e, some groups of Road Warriors will access some group of Servers (printers, Windows , Samba,etc). Our setup pictures three machines: our vpn hub, various Servers connected to this hub and various RW also connected to this very same hub. These Servers and RWs are both most likely to be behind NATs. One group of RWs is not allowed to see any group of servers but only the ones we assign. We use TAP because we need that each RW have access to all Server's network resources transparently. Each cluster (RWs+Server) will be under its own opervpn's hub tapX interface.
Now we are trying to do just one RW to access just one server. Baby steps!
Server:
server-bridge 'nogw'
port 1194
proto udp
dev tap
tls-server
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/cert.crt
key /etc/openvpn/keys/key.key
dh /etc/openvpn/keys/dh.pem
mode server
client-to-client
keepalive 10 120
max-clients 10
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 4
script-security 2
up /etc/openvpn/scripts/ss.sh
ss.sh contains:
#!/bin/bash
#
# starts up VPN.
# $dev is the tap device created by openvpn.
#
prefix=2222:1111:aaaa:1
ip link set $dev up
ip -6 addr add ${prefix}::1/64 dev $dev
Cliente (ubuntu) config contains:
remote opvpn.com.br
port 1194
proto udp
nobind
dev tap0
user nobody
group nogroup
persist-key
persist-tun
tls-client
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/client.crt
key /etc/openvpn/keys/client.key
dh /etc/openvpn/keys/dh.pem
script-security 2
verb 4
Client's network/inteface contains
auto lo tap0
iface lo inet loopback
iface tap0 inet manual
pre-up ip tuntap add tap0 mode tap user root
up ip link set dev tap0 up
post-down ip link del dev tap0
I also have a RADVD server running giving IPv6 addresses at opvpn.com.br (real name changed to protect the innocent!)
This setup is working fine. We can "see" the servers on the other tunnel end, ping them, mount them, etc.
The problem lays in the fact we will have to tamper with the RW computer's files more than we want. For instance: change its /etc/network/interfaces file.
Install openvpn and send our config file is all we would like to do. No tampering at all.
Here is what is NOT working: if we change "dev tap0" to "dev tap" at client´s config file to let openvpn handle the tap interface, this goes down the drain.
We see tap1 (tap0 already exists) be created but it does not goes UP, and, of course, no IPv6 addresses are created.
Why openvpn at client's side is not working when tapX device is created on the fly?
Regards BB