在Ubuntu 20.04上使用OpenVPN client來做remote-access VPN連線,步驟如下:
- 安裝OpenVPN
- 將.ovpn與.crt設定檔放到/etc/openvpn/下
- 啟動OpenVPN
步驟1:安裝OpenVPN
- sudo apt-get install openvpn
步驟2:設定檔xxx.ovpn與xxx.ca放到/etc/openvpn/下
- xxx.ovpn:OpenVPN的設定檔
- xxx.ca:OpenVPN的certificate檔案
步驟3:啟動OpenVPN
- sudo openvpn /etc/openvpn/xxx.ovpn
- curl https://ipinfo.io/ip && echo ""
第一個指令是啟動,第二個指令是看目前的IP位址。也可以加入alias,達成快速啟動:
- alias ovpn='sudo openvpn /etc/openvpn/xxx.ovpn'
- alias myip='curl https://ipinfo.io/ip && echo ""'
這樣只要用指令ovpn就可以直接連線,再用myip檢查目前的IP位址
參考資料
- Ubuntu 安装OpenVpn客户端:
提到client端需要六個檔案ca.crt, ca.key, client.crt, client.csr, client.key, client.ovpn,另外還有提到client.ovpn要怎樣編寫 - How to Find Local / Public IP Address in Ubuntu 20.04:看public IP
- What is the purpose of OpenVPN's /etc/openvpn/{client,server} directories?:解釋/etc/openvpn/下面資料夾的作用,但本次設定不需要
_EOF_
an awesome twilight day concept art of giant hen mixed with old hut, by kengo kuma and wes anderson with village, mixed development, cgsociety, fantastic realism, artstation hq
Steps: 23, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 4220395071, Size: 512x256, Model hash: a757fe8b3d, Model: chilloutmix, Version: v1.6.1
Time taken: 2 min. 16.5 sec.
A: 1.73 GB, R: 2.21 GB, Sys: 2.0/2 GB (100.0%)
沒有留言:
張貼留言