l2tp是中Internet隧道協議,通過對l2tp的設置能夠實現系統的聯網,那麼在Fedora 17系統下,要如何通過l2tp vpn來實現上網呢?其實很簡單,隨小編一起來學習下吧。
1.安裝l2tpd
sudo yum install l2tpd
2.配置文件
/etc/xl2tpd/xl2tpd.conf
port = 1701 ; * Bind to port 1701
access control = yes ; * Refuse connections without IP match
rand source = dev ; Source for entropy for random
[lac zju]
lns = 10.5.1.9 ; * Who is our LNS?
redial = yes ; * Redial if disconnected?
redial timeout = 3 ; * Wait n seconds between redials
max redials = 999 ; * Give up after n consecutive failures
require chap = yes ; * Require CHAP auth. by peer
refuse pap = yes ; * Refuse PAP authentication
require authentication = yes ; * Require peer to authenticate
ppp debug = no ; * Turn on PPP debugging
pppoptfile = /etc/xl2tpd/options ; * ppp options file for this lac
name = USERNAME@SERVICE_TYPE
[img]http://common.cnblogs.com/images/copycode.gif[/img]
/etc/ppp/chap-secrets
USERNAME@SERVICE_TYPE * PASSWORD *
3.啟動xl2tpd
sudo service start xl2tpd
或者
sudo /etc/rc.d/init.d/xl2tpd start
4.連接
sudo echo “d zju”》/var/run/xl2tpd/l2tp-control
#這裡的zju要和配置文件中的的lac 後面的字節一樣
5.查看是否連接
ip addr show | grep ‘inet.*ppp’
有輸出就是連接上了
6.設置路由
ip route add default dev ppp0
7.斷開
sudo echo “d zju”》/var/run/xl2tpd/l2tp-control
上面就是Fedora通過l2tp vpn聯網的方法介紹了,因為l2tp不是系統自帶的,需要自己下載安裝,在進行相關配置使用。