Page 1 of 1

openvpn

PostPosted: Feb 13th, '13, 16:19
by neophyte
Bonjour,
4 différentes maniéres de configurer une connexion vpn dans mageia 3.
Ai tout tenté, mais sans succés.
Merci de vos solutions

Re: opennpv

PostPosted: Feb 13th, '13, 16:56
by isadora
Neophyte, first welcome to the Mageia forum!!! :)

It would be wise posting in English, for this is the international forum.
For Mageia in the French language i could point you at:
http://www.mageialinux-online.org/forum/

Then, i changed your title to what it is now. ;)

Have good times around!!!

Re: openvpn

PostPosted: Feb 13th, '13, 17:55
by oj
I refer to this when openvpn isn't working as expected:

http://www.techrepublic.com/blog/openso ... erver/1873

It always works if I follow those instructions.

Re: openvpn

PostPosted: Feb 15th, '13, 17:19
by wintpe
ok you asked via a crosspost how to configure openvpn.

in mageia 2 all i can say, is follow the prompts in the gui tool, and it works.

in mageia 1 it was problematic so i set it up manualy.

when ive finished setting it up, with the gui the resulting config is stored in a file

/etc/sysconfig/network-scripts/vpn.d/openvpn/name.conf where name is the name you gave this instance in the gui.

the contents of this file is as follows obscured for my own security.

i use this command to display this to remove the comments , and commented out lines.

cat name.conf |grep -v ^#|grep -v ^\;

Code: Select all
client
dev tun
remote my.ip.address.vpn portnumber
resolv-retry infinite
nobind
persist-key
persist-tun
ca /keystorage/ca.crt
cert /keystorage/peternc10.crt
key /keystorage/peternc10.key
comp-lzo
verb 3


the files in /keystorage are created when setting up the openvpn server and should be provided by your provider

once your normal lan is online, you start your vpn, via the gui if you wish and you can assosiate a vpn config with a lan config wireless or wired so that it starts
automaticly.

when you start it this is the sort of thing you should see.

Code: Select all
[root@localhost ~]# ifconfig -a

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.6  P-t-P:10.8.0.5  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:15030 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15333 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:19764181 (18.8 MiB)  TX bytes:1000021 (976.5 KiB)

wlan0     Link encap:Ethernet  HWaddr C4:85:08:49:3B:30
          inet addr:10.199.199.199  Bcast:10.199.199.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:118894 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42000 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:36073805 (34.4 MiB)  TX bytes:7485892 (7.1 MiB)


the tun0 is an ssh like tunnel that goes out over your wlan or lan, and connects with the port on your REMOTE server.

traffic is routed down this tunnel presented as another route for your data

so your routing tables should look something like

ive messed with all those 199.199 values for privacy reasons

Code: Select all
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         10.199.199.251    0.0.0.0         UG        0 0          0 wlan0
10.8.0.0        10.8.0.5        255.255.255.0   UG        0 0          0 tun0
10.8.0.5        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.199.199.0      0.0.0.0         255.255.254.0   U         0 0          0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 wlan0
192.168.1.0     10.8.0.5        255.255.255.0   UG        0 0          0 tun0
192.168.2.0     10.8.0.5        255.255.255.0   UG        0 0          0 tun0

hope that helps

regards peter