差異處
這裏顯示兩個版本的差異處。
下次修改 | 前次修改 | ||
tech:openvpn-client_ubuntu [2022/06/02 19:10] – 建立 jonathan | tech:openvpn-client_ubuntu [2023/04/19 12:40] (目前版本) – jonathan | ||
---|---|---|---|
行 9: | 行 9: | ||
===== 設定 OpenVPN Client ===== | ===== 設定 OpenVPN Client ===== | ||
- | * 先透過 OpenVPN Server 取得到相關的憑證設定檔, | + | * 先透過 OpenVPN Server 取得到相關的憑證設定檔, |
- | * 將取得的 | + | * 將取得的 |
- | [root@openvpn-client openvpn]# pwd | + | root@amalia:/ |
/ | / | ||
- | [root@openvpn-client openvpn]# ls | + | root@amalia:/ |
- | ca.crt ideas_tp.conf | + | amalia_gpu.ovpn client |
</ | </ | ||
- | * 透過手動命令列方式來確認是否設定檔都正確 | + | * 透過手動命令列方式來確認是否設定檔都正確 |
- | [root@openvpn-client openvpn]# openvpn --config | + | root@amalia:/ |
- | Tue May 20 15:22:24 2014 OpenVPN 2.3.2 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Sep 12 2013 | + | Jun 2 19:18:20 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Mar 22 2022 |
- | Tue May 20 15:22:24 2014 WARNING: file ' | + | Jun 2 19:18:20 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10 |
- | Tue May 20 15:22:24 2014 WARNING: file 'ta.key' is group or others accessible | + | Jun 2 19:18:20 Outgoing Control Channel Authentication: |
- | Tue May 20 15:22:24 2014 Control Channel Authentication: | + | Jun 2 19:18:20 Incoming Control Channel Authentication: |
- | Tue May 20 15:22:24 2014 Outgoing Control Channel Authentication: | + | |
- | Tue May 20 15:22:24 2014 Incoming Control Channel Authentication: | + | |
- | Tue May 20 15:22:24 2014 Socket Buffers: R=[87380-> | + | |
- | Tue May 20 15:22:24 2014 Attempting to establish TCP connection with [AF_INET]175.98.115.2: | + | |
: | : | ||
: | : | ||
- | Tue May 20 15:22:28 2014 /sbin/ip route add 192.168.102.0/24 via 192.168.201.61 | + | Jun 2 19:18:23 /sbin/ip route add 10.20.0.0/24 via 10.121.101.73 |
- | Tue May 20 15:22:28 2014 /sbin/ip route add 192.167.102.0/24 via 192.168.201.61 | + | Jun 2 19:18:23 /sbin/ip route add 10.50.1.0/24 via 10.121.101.73 |
- | Tue May 20 15:22:28 2014 /sbin/ip route add 192.168.201.1/32 via 192.168.201.61 | + | Jun 2 19:18:23 /sbin/ip route add 10.121.101.0/24 via 10.121.101.73 |
- | Tue May 20 15:22:28 2014 Initialization Sequence Completed | + | |
</ | </ | ||
- | * 將 範例的 | + | * 將 範例的 |
- | [root@openvpn-client | + | cp amalia_gpu.ovpn |
- | 正在啟動 openvpn: | + | </cli> |
- | </code> | + | * 設定開機自動連上去 VPN Server <cli> |
- | * 設定開機自動連上去 VPN Server <code sh> | + | sudo vi / |
- | chkconfig | + | </cli>< |
- | </code>< | + | : |
- | [root@openvpn-client openvpn]# chkconfig --list | + | AUTOSTART=" |
- | openvpn | + | : |
- | </file> | + | </ |
+ | sudo systemctl enable | ||
+ | sudo systemctl daemon-reload | ||
+ | sudo service openvpn@client | ||
+ | </ | ||
+ | * 確認連上 OpenVPN Server 所取得的 IP < | ||
+ | ip a | grep tun | ||
+ | </ | ||
+ | root@amalia:/ | ||
+ | 11: tun0: < | ||
+ | inet 10.121.101.74 peer 10.121.101.73/ | ||
+ | </ | ||
+ | |||
+ | ===== 取消與關閉 | ||
+ | * < | ||
+ | sudo service openvpn@client stop | ||
+ | sudo systemctl disable [email protected] | ||
+ | sudo systemctl daemon-reload | ||
+ | </ | ||
+ | * 確認已經沒有連上 OpenVPN Server 所取得的 IP < | ||
+ | ip a | grep tun | ||
+ | </cli>結果應該不會出現任何 ip | ||
===== 參考網址 ===== | ===== 參考網址 ===== | ||
* https:// | * https:// | ||
+ | * https:// | ||
{{tag> | {{tag> | ||