Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Réglage du réseau (suite)

3 réponses
Avatar
Nicolas FRANCOIS
--Sig_/Rz7JpX/K7+z31x_M9+dYkrF
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Salut.

Avec vos diff=C3=A9rents conseils (merci encore =C3=A0 tous ceux qui ont eu=
la
patience de lire mes calembredaines et d'y trouver un sens), j'ai d=C3=A9ci=
d=C3=A9
de sauter le pas : j'ai d=C3=A9sactiv=C3=A9 NetworkManager, et suis pass=C3=
=A9 =C3=A0
systemd.networkd. Pour le moment, tout va bien. Enfin, pour ce qui
concerne la connexion de base.

Si je me connecte =C3=A0 mon VPN HMA, je n'ai plus de connexion vers
l'ext=C3=A9rieur (je peux pinger mon firewall, mais pas Google.com). J'ai
remarqu=C3=A9 qu'il y a dans les services activ=C3=A9s un service "openvpn@=
HMA",
que je n'ai pas demand=C3=A9, mais je suppose qu'il a =C3=A9t=C3=A9 cr=C3=
=A9=C3=A9 la premi=C3=A8re
fois que j'ai utilis=C3=A9 le script HMA de connexion.

Mes besoins :
- au d=C3=A9marrage, activer la connexion ethernet (check),
- APR=C3=88S, connecter mes r=C3=A9pertoires r=C3=A9seau (je sais comment f=
aire, mais
je dois encore trouver O=C3=99 le faire,
- ensuite, d=C3=A9marrer le d=C3=A9mon openvpn avec le script de HMA qui va=
bien,
sans avoir =C3=A0 rentrer mon nom d'utilisateur et mon mot de passe (l=C3=
=A0,
il va me falloir de l'aide !),
- indiquer =C3=A0 la table de routage que tout le trafic passe par le tunnel
VPN, SAUF quelques trucs particulier, genre le serveur SMTP de Free,
et deux ou trois sites qui n'aiment pas qu'on les visite =C3=A0 travers un
VPN.

Si j'arrive =C3=A0 faire =C3=A7a avant les vacances, je suis un homme heure=
ux :-)

=C3=80 votre bon coeur, m'sieurs-dames. Le mieux serait de m'indiquer des
documentations expliquant clairement comment on peut faire quand on est
nouveau dans le bouzin systemd.

Avec bien-s=C3=BBr pour vous la r=C3=A9compense de ma reconnaissance =C3=A9=
ternelle !

\bye

--=20

Nicolas FRANCOIS | /\=20
http://nicolas.francois.free.fr | |__|
X--/\\
We are the Micro$oft. _\_V
Resistance is futile. =20
You will be assimilated. darthvader penguin

--Sig_/Rz7JpX/K7+z31x_M9+dYkrF
Content-Type: application/pgp-signature
Content-Description: Signature digitale OpenPGP

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE7s3+BtBEQX/Kgdk7xYgnps2M/gEFAllkIjoACgkQxYgnps2M
/gE3BggApQFKtUKGyL7/VcotiSt+wviA6RL2eezrO3sl9pNRTvKASYKejqxHLUv8
gm35wrnhPW+IGkJF9xlRAXT//TzrI2sXiQ/l7+7Lm8C8vIqG7/ATthGEF30WGrLy
urGwWeSiqW/rf4PD7qavdRgV99QWjGIkTwTHbyQaaTjXlcRfZUn6ms+QsMVfLT4g
oOlUuGfO1vo8YLUsX2TJt+nRUPcLEvKE8r+nD2NdENrP7vq07WvCbmb3/osL9woY
d9i2gRI3eUez7iSbT+/Z0tMsjA5wPYmIbu599b7lYrgVXUk4ebLGn311uiNiT2EV
5bgaIvgYXzp7GcHP6JohnigFimTaEA==
=03/w
-----END PGP SIGNATURE-----

--Sig_/Rz7JpX/K7+z31x_M9+dYkrF--

3 réponses

Avatar
Jean-Michel OLTRA
Bonjour,
Le mardi 11 juillet 2017, Nicolas FRANCOIS a écrit...
- ensuite, démarrer le démon openvpn avec le script de HMA qui va bien,
sans avoir à rentrer mon nom d'utilisateur et mon mot de passe (là,
il va me falloir de l'aide !),

Le script hma-vpn.sh offre une option -c pour donner le chemin vers le
fichier d'authentification. Dans ce fichier, tu mets sur la première ligne
ton login, et pour la seconde, ton mot de passe.
Ensuite tu peux créer un service systemd avec pour ExecStart la ligne de
commande qui va bien pour ton hma-vpn.sh (-c auth -p proto serveur-rocks)
Il y a pléthore de doc sur le ouèbe concernant les fichiers de démarrage
pour systemd. Yaka lire !
Avec bien-sûr pour vous la récompense de ma reconnaissance éternelle !

Mouais. J'y crois pas trop, à l'éternité !
--
jm
Avatar
Nicolas FRANCOIS
--Sig_/eb7oztGTOZn5niqynRD8PFF
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Suite de mes aventures...
J'ai créé un fichier /etc/systemd/system//overr ide.conf :
[Unit]
Description=OpenVPN connection to %i
After=network.target
[Service]
ExecStart=
ExecStart=/usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.sta tus 10 --config /etc/openvpn/client/%i.conf --auth-user-pass /etc/openvpn/a uth/hma.auth
WorkingDirectory=/etc/openvpn
(le ExecStart en double me vient d'une lecture de StackExchange : pour
cette option précisément, il est nécessaire de vider la comm ande par
défaut avant de lui substituer une autre.)
Lorsque je lance la commande ci-dessus en ligne de commande (en
remplaçant %i par HMA, HMA.conf étant un lien symbolique vers cel ui des
fichiers de configuration fournis par HMA que je souhaite utiliser),
tout se passe bien, je crée bien le tunnel qui va bien, et mon adresse
IP par défaut est modifiée.
Par contre, quand je lance le script avec 'sudo systemctl start
', j'obtiens ça dans les logs (journalctl -f) :
juil. 11 19:16:41 Gaston sudo[14057]: nico : TTY=pts/1 ; PWD=/etc/s ystemd ; USER=root ; COMMAND=/bin/systemctl start
juil. 11 19:16:41 Gaston sudo[14057]: pam_unix(sudo:session): session opene d for user root by (uid=0)
juil. 11 19:16:41 Gaston systemd[1]: Starting OpenVPN connection to HMA...
juil. 11 19:16:41 Gaston ovpn-HMA[14060]: OpenVPN 2.4.0 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jun 22 2017
juil. 11 19:16:41 Gaston systemd[1]: : PID file /run/ope nvpn/HMA.pid not readable (yet?) after start: No such file or directory
juil. 11 19:16:41 Gaston ovpn-HMA[14060]: library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.08
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: TCP/UDP: Preserving recently used remote address: [AF_INET]5.62.38.12:553
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: Socket Buffers: R=[212992->2129 92] S=[212992->212992]
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: UDP link local: (not bound)
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: UDP link remote: [AF_INET]5.62.38 .12:553
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: TLS: Initial packet from [AF_INET ]5.62.38.12:553, sidf68ebc aa7f9a1c
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: WARNING: this configuration may c ache passwords in memory -- use the auth-nocache option to prevent this
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: VERIFY OK: depth=1, C=UK, ST =London, L=London, O=Privax Ltd, OU=HMA Pro VPN, CN=hidemyass.com , emailAddress=
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: VERIFY OK: nsCertType=SERVER
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: VERIFY OK: depth=0, C=UK, ST =London, L=London, O=Privax Ltd, OU=HMA Pro VPN, CN=server, email Address=
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
juil. 11 19:16:41 Gaston ovpn-HMA[14061]: [server] Peer Connection Initiate d with [AF_INET]5.62.38.12:553
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: SENT CONTROL [server]: 'PUSH_REQU EST' (status=1)
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: PUSH: Received control message: ' PUSH_REPLY,dhcp-option DNS 100.120.0.1,redirect-gateway def1,ping 9,ping-re start 30,explicit-exit-notify 1,route-gateway 100.120.248.1,topology subnet ,redirect-gateway def1,ifconfig-ipv6 2001:db8:123::2/64 2001:db8:123::1,rou te-ipv6 2000::/3 2001:db8:123::1,explicit-exit-notify 2,ifconfig 100.120.24 8.193 255.255.252.0'
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Option 'explicit-exit-notify' in [PUSH-OPTIONS]:5 is ignored by previous <connection> blocks
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Option 'explicit-exit-notify' in [PUSH-OPTIONS]:11 is ignored by previous <connection> blocks
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: timers and/or tim eouts modified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: explicit notify p arm(s) modified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: --ifconfig/up opt ions modified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: route options mod ified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: route-related opt ions modified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Data Channel Encrypt: Cipher 'AES -256-CBC' initialized with 256 bit key
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Data Channel Encrypt: Using 160 b it message hash 'SHA1' for HMAC authentication
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Data Channel Decrypt: Cipher 'AES -256-CBC' initialized with 256 bit key
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Data Channel Decrypt: Using 160 b it message hash 'SHA1' for HMAC authentication
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: ROUTE_GATEWAY 192.168.10.1/255.25 5.255.0 IFACE=enp3s0 HWADDRD:8a:5b:99:7e:e1
juil. 11 19:16:42 Gaston systemd-networkd[426]: tun0: Gained carrier
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: GDG6: remote_host_ipv6=n/a
juil. 11 19:16:42 Gaston systemd-timesyncd[637]: Network configuration chan ged, trying to establish connection.
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: ROUTE6: default_gateway=UNDEF
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: TUN/TAP device tun0 opened
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: TUN/TAP TX queue length set to 100
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: do_ifconfig, tt->did_ifconfig_ipv 6_setup=1
juil. 11 19:16:42 Gaston systemd-networkd[426]: tun0: Gained IPv6LL
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip link set dev tun0 up mtu 1500
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip addr add dev tun0 100.12 0.248.193/22 broadcast 100.120.251.255
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip -6 addr add 2001:db8:123 ::2/64 dev tun0
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip route add 5.62.38.12/32 via 192.168.10.1
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: ERROR: Linux route add command fa iled: external program exited with error status: 2
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip route add 0.0.0.0/1 via 100.120.248.1
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip route add 128.0.0.0/1 vi a 100.120.248.1
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: add_route_ipv6(2000::/3 -> 2001:d b8:123::1 metric 1) dev tun0
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip -6 route add 2000::/3 de v tun0 metric 1
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: Initialization Sequence Completed
juil. 11 19:16:43 Gaston systemd-timesyncd[637]: Synchronized to time serve r 195.43.74.123:123 (0.debian.pool.ntp.org).
juil. 11 19:17:01 Gaston CRON[14081]: pam_unix(cron:session): session opene d for user root by (uid=0)
juil. 11 19:17:01 Gaston CRON[14082]: (root) CMD ( cd / && run-parts --re port /etc/cron.hourly)
juil. 11 19:17:01 Gaston CRON[14081]: pam_unix(cron:session): session close d for user root
juil. 11 19:18:11 Gaston systemd[1]: : Start operation t imed out. Terminating.
juil. 11 19:18:11 Gaston systemd[1]: : Killing process 1 4061 (openvpn) with signal SIGKILL.
juil. 11 19:18:11 Gaston systemd-networkd[426]: tun0: Lost carrier
juil. 11 19:18:11 Gaston systemd-timesyncd[637]: Network configuration chan ged, trying to establish connection.
juil. 11 19:18:11 Gaston systemd[1]: Failed to start OpenVPN connection to HMA.
juil. 11 19:18:11 Gaston systemd[1]: : Unit entered fail ed state.
juil. 11 19:18:11 Gaston systemd[1]: : Failed with resul t 'timeout'.
juil. 11 19:18:11 Gaston sudo[14057]: pam_unix(sudo:session): session close d for user root
juil. 11 19:18:11 Gaston systemd-timesyncd[637]: Synchronized to time serve r 195.43.74.123:123 (0.debian.pool.ntp.org).
donc un timeout, d'ailleurs, je ne récupère pas la main sur la li gne de
commande avant l'échec. Et là, je craque un petit peu : c'est quo i, le
problème, docteur ?
Mes promesses de reconnaissance éternelle (ou à long terme pour l es non
croyants) tiennent toujours :-)
bye
--
Nicolas FRANCOIS | /
http://nicolas.francois.free.fr | |__|
X--/
We are the Micro$oft. __V
Resistance is futile.
You will be assimilated. darthvader penguin
--Sig_/eb7oztGTOZn5niqynRD8PFF
Content-Type: application/pgp-signature
Content-Description: Signature digitale OpenPGP
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCAAdFiEE7s3+BtBEQX/Kgdk7xYgnps2M/gEFAlllCfkACgkQxYgnps2M
/gFvAwf+IW/2gZCV/xfQI+BeHMveNSPoYD8Be5INhX/DQXXHX3qlxGjE2BX3fu74
Jcsy9Qh/zZOiqhoBs3pl8fmWz/x+5XbHDhPqsED5IPkfQ1lFcCB4eoyQVqhX3m6P
mFjD6HQR69rZvCIctvOR2uvtkgfEDBg5pslVemiUIfKD5D2iVf6nucYEN2nkHeXm
Dc+vw62G90b9u4MNc9g326fYU7WGSk5Utl7Cv1+x/mb+6iCDNmUGZWaGj4GwWOfH
kK5fYdoDK1Ho0AeatEE0Hb7w7kXU5/BHl774qrSuU1j3irJO84E+9QoU9qaH25cd
7th6Uir2k6PGItz/Elqk+cvkiSurSg= =No4c
-----END PGP SIGNATURE-----
--Sig_/eb7oztGTOZn5niqynRD8PFF--
Avatar
Christophe
Bonsoir,
Dans le genre, "la clé est derrière la porte", a mon avis, le problème
est là.
Le 11/07/2017 à 19:25, Nicolas FRANCOIS a écrit :
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: /sbin/ip route add 5.62.38.12/32 via 192.168.10.1
juil. 11 19:16:42 Gaston ovpn-HMA[14061]: ERROR: Linux route add command failed: external program exited with error status: 2

Par la suite, il y a des routes ajoutées vers 0.0.0.0/1 et 128.0.0.0/1
qui du coup prennent le pas sur la route statique vers le "endpoint"
VPN, le rendent injoignable, d'ou le timeout.
Reste à savoir à quoi correspond le "error status" 2 dans ce contexte.
(Vague idée : l'option "script-security" ?)
@+
Christophe.