Solaris10 PPPoE ADSL設定

一、查看有無安裝PPPoE套件(預設Solaris已經有裝套件了.......還滿貼心的一堆套件都已經內含不需要在外裝)
# pkginfo | grep ppp
system      SUNWpppd                         Solaris PPP Device Drivers
system      SUNWpppdr                        Solaris PPP configuration files
system      SUNWpppdt                        Solaris PPP Tunneling
system      SUNWpppdu                        Solaris PPP daemon and utilities
system      SUNWpppg                         GNU utilities for PPP



#grep sppp /etc/name_to_major
sppp 146
sppptun 147

確認第二張網卡有安裝起來
# cat /var/adm/messages | grep pci
May  5 09:39:13 sun10 genunix: [ID 936769 kern.info] rtls1 is /pci@0,0/pci10ec,8139@9

# echo rtls0 > /etc/ppp/pppoe.if

建立撥號配置Hinet文件
# touch /etc/ppp/peers/hinet
================hinet===============
sppptun
plugin pppoe.so
connect "/usr/lib/inet/pppoec rtls1"    #要撥接的網卡
persist                                       
user "888888@hinet.net"       #帳號
password "123456789abc"   #密碼                          
noauth
noipdefault
noccp
novj
noaccomp
nopcomp
defaultroute
holdoff 5
maxfail 0

====================================
 

在檔案的最後面輸入帳號與密碼
# vi /etc/ppp/pap-secrets
99999999@ip.hinet.net   98765432

在檔案的最後面輸入帳號與密碼
# vi /etc/ppp/chap-secrets
99999999@ip.hinet.net   76543212

修改resolv.conf檔案
#vi  /etc/resolv.conf
#Hinet
nameserver 168.95.1.1

修改defaultrouter清成空白
#vi /etc/defaultrouter

榜定網卡,建立撥號
# sppptun plumb pppoed rstls1
# sppptun plumb pppoe rstls1

查看是否設定正確
# sppptun query
rtls1:pppoed
rtls1:pppoe

#/usr/lib/inet/pppoec -i rstls1

撥號
# /usr/bin/pppd call hinet

查看是否取得IP(出現sppp0表示OK)
# ifconfig -a
sppp0: flags=10010008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4,FIXEDMTU> mtu 1492 index 4
        inet 122.132.16.175 --> 138.195.18.233 netmask ff000000
        ether 0

將撥號設定一開機就執行
# vi /etc/rc2.d/S48Hinet
sppptun plumb pppoed  rstls1
sppptun plumb pppoe rstls1
/usr/bin/pppd call hinet

變更權限
# chmod u+x /etc/rc2.d/S48Hinet

大功告成..............

Q&A:
查看Log檔,會發現撥接會時常段線後無法重撥
# cat /var/adm/messages | grep pppd
May  6 23:58:43 sun10 pppd[704]: [ID 702911 daemon.notice] Modem hangup
May  6 23:58:43 sun10 pppd[704]: [ID 702911 daemon.notice] Connection terminated.

修改 # /etc/ppp/peers/hinet 如下,目前測試中....
sppptun
plugin pppoe.so
connect "/usr/lib/inet/pppoec rtls1"     # dial into ISP
persist                            #段線自動重撥
user "CCCCCCCC@pp.hinet.net"                # my account name at my ISP
password 99999999
noauth                  # do not authenticate the ISP's identity (client)
noipdefault             # assume no IP address; get it from ISP
defaultroute            # install default route; ISP is Internet gateway
updetach                # log errors and CONNECT string to invoker
noccp                   # ISP doesn't support free compression
novj
noaccomp
nopcomp
holdoff 5    #段線重撥等待5秒
maxfail 0

arrow
arrow
    全站熱搜

    蒼穹 發表在 痞客邦 留言(0) 人氣()