VPN: Difference between revisions
Jump to navigation
Jump to search
(Created page with " == Principe == * Connecter des hôtes/réseaux distants "comme si" ils appartiennent au même réseau local * Chiffrer / Authentifier tout ce qui passe sur les réseaux publ...") |
No edit summary |
||
Line 1: | Line 1: | ||
= Présentation CT = | |||
== Principe == | == Principe == | ||
Line 11: | Line 11: | ||
* OpenVPN : Interfaces virtuelles, Linux, portage Windows, SSL, flexible | * OpenVPN : Interfaces virtuelles, Linux, portage Windows, SSL, flexible | ||
* L2 VPN ou L3 VPN | * L2 VPN ou L3 VPN | ||
** Encapsulation de la trame Ethernet (L2) ou paquet IP (L3) | ** Encapsulation de la trame Ethernet (L2) ou paquet IP (L3) | ||
** | ** Fonctionnement des applications non-IP | ||
* Réseau VPN VLAN dédié | |||
** meilleur isolation, pas le VLAN de production | |||
** non lié à un site | |||
* Réseau VPN | ** besoin de configuration des routeurs G5K | ||
* Encapsulation dans UDP (+ TCP ?) | |||
* Encapsulation dans UDP | |||
== Configuration client == | == Configuration client == | ||
Line 36: | Line 25: | ||
* persistence: | * persistence: | ||
** Par nom de certificat / login | ** Par nom de certificat / login | ||
* | ** DNS name: vpn1.grid5000.fr, vpn2.grid5000.fr ou <login>.vpn.grid5000.fr | ||
* DNS name: vpn1.grid5000.fr, vpn2.grid5000.fr ou <login>.vpn.grid5000.fr | |||
* routes G5K (Golden rules !) | * routes G5K (Golden rules !) | ||
** 172.16.0.0/16 | ** 172.16.0.0/16 | ||
** 10.0.0.0/8 | ** 10.0.0.0/8 ? | ||
* DNS G5K | * DNS G5K | ||
* Authentification Client | |||
** Génération certificat Client à la demande | |||
== Securité == | == Securité == | ||
Line 52: | Line 39: | ||
** Fail2ban, etc. | ** Fail2ban, etc. | ||
* | = L2 Ethernet Networks = | ||
Some additional VLAN is needed : | |||
* <code class='host'>VPN</code> : Hosts connected to Grid5000 using VPN access use a dedicated VLAN implemented in ?? site. | |||
== Vlan number == | |||
{|class="karafon" | |||
! VLAN number !! Usage !! Name | |||
|- | |||
| 600 || <code class="host">VPN network</code> || <code class="host">VPN</code> | |||
|} | |||
= L3 IP Networks = | |||
== Routing policy == | |||
The following table gives detail about the routing policy of each L2 VLAN : | |||
{| | |||
|- style="background-color: #cccccc; border:1px solid #c9c9c9;" | |||
! Network !! Routed locally !! Routed globally | |||
|- | |||
| VPN network || {{Yes}} || {{Yes}} | |||
|} | |||
== Addressing plan == | |||
=== About VPN === | |||
{| | |||
|- style="background-color: #cccccc; border:1px solid #c9c9c9;" | |||
! Site !! VPN | |||
|- | |||
| ? || <code class="host">172.20.0.0/16</code> | |||
|} | |||
= Configuration = | |||
== DomU == | |||
=== Network interfaces configuration === | |||
# The loopback network interface | |||
auto lo | |||
iface lo inet loopback | |||
# The DMZ network interface | |||
auto eth0 | |||
iface eth0 inet static | |||
address 172.16.63.199 | |||
gateway 172.16.63.254 | |||
netmask 255.255.240.0 | |||
# The VPN network interface | |||
auto br-vpn | |||
iface br-vpn inet manual | |||
bridge-ports eth1 tap0 | |||
pre-up ip tuntap add dev tap0 mode tap | |||
=== OpenVPN configuration === | |||
{{Managed by Puppet|classes=openvpn,openvpng5k|note=}} | |||
== Dom0 == | |||
sudo vconfig add eth0 600 | |||
sudo brctl addbr switch-vpn | |||
sudo brctl addif switch-vpn eth0.600 | |||
sudo ifconfig eth0.600 up | |||
sudo ifconfig switch-vpn up | |||
cat /etc/xen/vpn.cfg | |||
vif = [ 'ip=172.16.63.199,mac=00:16:3E:00:A2:CD,bridge=switch-prod', # Will be DMZ | |||
'mac=00:16:3E:00:FE:CD,bridge=switch-vpn'] | |||
== Network Equipment == | |||
=== On equipment hosting VPN === | |||
create vlan VPN | |||
configure vlan "VPN" tag 600 | |||
show configuration | |||
configure vlan "VPN" ipaddress 172.20.255.254 255.255.0.0 | |||
enable ipforwarding vlan "VPN" | |||
configure vlan "VPN" add ports 2:32 tagged #Dom0 port | |||
=== On other sites' routers === | |||
route add 172.20.0.0/16 gw 192.168.4.<VPN_site> | |||
== VPN Client == | |||
OpenVPN's client.conf file: | |||
client | |||
remote access.lyon.grid5000.fr 1194 | |||
proto udp | |||
ca ca.crt | |||
cert client1.crt | |||
key client1.key | |||
#tls-auth ta.key 1 | |||
dev tap |
Revision as of 14:55, 9 July 2013
Présentation CT
Principe
- Connecter des hôtes/réseaux distants "comme si" ils appartiennent au même réseau local
- Chiffrer / Authentifier tout ce qui passe sur les réseaux publiques
- Intêret pour G5K
- S'affranchir de la passerelle SSH
- Accès au monde extérieur (à un serveur, à un réseau)
Implémentation
- OpenVPN : Interfaces virtuelles, Linux, portage Windows, SSL, flexible
- L2 VPN ou L3 VPN
- Encapsulation de la trame Ethernet (L2) ou paquet IP (L3)
- Fonctionnement des applications non-IP
- Réseau VPN VLAN dédié
- meilleur isolation, pas le VLAN de production
- non lié à un site
- besoin de configuration des routeurs G5K
- Encapsulation dans UDP (+ TCP ?)
Configuration client
- addresse IP dans réseau VPN
- persistence:
- Par nom de certificat / login
- DNS name: vpn1.grid5000.fr, vpn2.grid5000.fr ou <login>.vpn.grid5000.fr
- routes G5K (Golden rules !)
- 172.16.0.0/16
- 10.0.0.0/8 ?
- DNS G5K
- Authentification Client
- Génération certificat Client à la demande
Securité
- Serveur : Idem access nationale
- 1 interface DMZ + 1 interface VLAN VPN
- Fail2ban, etc.
L2 Ethernet Networks
Some additional VLAN is needed :
VPN
: Hosts connected to Grid5000 using VPN access use a dedicated VLAN implemented in ?? site.
Vlan number
VLAN number | Usage | Name |
---|---|---|
600 | VPN network |
VPN
|
L3 IP Networks
Routing policy
The following table gives detail about the routing policy of each L2 VLAN :
Network | Routed locally | Routed globally |
---|---|---|
VPN network |
Addressing plan
About VPN
Site | VPN |
---|---|
? | 172.20.0.0/16
|
Configuration
DomU
Network interfaces configuration
# The loopback network interface auto lo iface lo inet loopback # The DMZ network interface auto eth0 iface eth0 inet static address 172.16.63.199 gateway 172.16.63.254 netmask 255.255.240.0 # The VPN network interface auto br-vpn iface br-vpn inet manual bridge-ports eth1 tap0 pre-up ip tuntap add dev tap0 mode tap
OpenVPN configuration
Dom0
sudo vconfig add eth0 600 sudo brctl addbr switch-vpn sudo brctl addif switch-vpn eth0.600 sudo ifconfig eth0.600 up sudo ifconfig switch-vpn up cat /etc/xen/vpn.cfg vif = [ 'ip=172.16.63.199,mac=00:16:3E:00:A2:CD,bridge=switch-prod', # Will be DMZ 'mac=00:16:3E:00:FE:CD,bridge=switch-vpn']
Network Equipment
On equipment hosting VPN
create vlan VPN configure vlan "VPN" tag 600 show configuration configure vlan "VPN" ipaddress 172.20.255.254 255.255.0.0 enable ipforwarding vlan "VPN" configure vlan "VPN" add ports 2:32 tagged #Dom0 port
On other sites' routers
route add 172.20.0.0/16 gw 192.168.4.<VPN_site>
VPN Client
OpenVPN's client.conf file:
client remote access.lyon.grid5000.fr 1194 proto udp ca ca.crt cert client1.crt key client1.key #tls-auth ta.key 1 dev tap