OpenVPN-2.1.1HowTo/Asignar Direcciones Fijas a Clientes

De WikiCabal
Ir a la navegación Ir a la búsqueda

Asignar Direcciones Fijas a Clientes

[rrc@charon ~]$ su -
Password: 
[root@charon ~]# cd /etc/openvpn
[root@charon openvpn]# mkdir ccd
[root@charon openvpn]# cd ccd
[root@charon ccd]# vi rrc
ifconfig-push 10.8.0.249 10.8.0.250
[root@charon ccd]# cd ..
[root@charon openvpn]# vi server.conf 
local 192.168.51.136
proto udp
dev tun
ca ca.crt
cert charon.linuxcabal.org.crt
key charon.linuxcabal.org.key  # This file should be kept secret
crl-verify crl.pem
dh dh1024.pem

## Para system-D
script-security 2

server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
# duplicate-cn
keepalive 10 120
comp-lzo
max-clients 10
user openvpn
group openvpn
persist-key
persist-tun
status openvpn-status.log
log         openvpn.log
log-append  openvpn.log
verb 3
mute 20
### Para enviar una ruta global a todos los clientes de VPN
push "route 172.16.51.0 255.255.255.0"

### Para enviar direcciones fijas a cada cliente
client-config-dir ccd
[root@charon openvpn]# service openvpn restart
Shutting down openvpn:                                          [  OK  ]
Starting openvpn:                                               [  OK  ]
[root@AbelLap init.d]# systemctl restart openvpn@rrc.service
[root@AbelLap init.d]# ifconfig
eth0      Link encap:Ethernet  HWaddr 78:E7:D1:DC:B9:A2  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:46 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:69 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9635 (9.4 KiB)  TX bytes:9635 (9.4 KiB)

tun0      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.249  P-t-P:10.8.0.250  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

wlan0     Link encap:Ethernet  HWaddr 70:F1:A1:6D:8B:F6  
          inet addr:192.168.51.160  Bcast:192.168.51.255  Mask:255.255.255.0
          inet6 addr: 2002:bda2:69b1:0:72f1:a1ff:fe6d:8bf6/64 Scope:Global
          inet6 addr: fe80::72f1:a1ff:fe6d:8bf6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19301 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17298 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7160670 (6.8 MiB)  TX bytes:2499640 (2.3 MiB)


Explicación