Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

PPP to dial ISP
 

 

Let's get to the point, check the tun0 device in /dev , if there are no tun* devices then create them by this following command :

#cd /dev

#sh MAKEDEV tun0     or    #sh MAKEDEV tun15    ( this will create tun0, ... ,tun15 ).

check the modem device in /dev , or you can create them by :

#sh MAKEDEV cuaa  ( this will create cuaa* devices ). 

make sure you have done the steps above, and now we will need ppp.conf file in /etc/ppp/ . You can get the ppp.conf.sample in /usr/share/example/ppp/ for the sample configuration. Here is ppp.conf file in my FreeBSD machine:

        #PPP.CONF 

        default:
        set log Phase Chat LCP IPCP CCP tun command
        set device /dev/cuaa0                        #COM1=cuaa0 COM2=cuaa1
        set speed 115200                               #or try 38400
        set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
        \"\" ATM OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
        set timeout 180                                 # 3 minute idle timer (the default)
        enable dns                                         # request DNS info (for resolv.conf)

        telkom:                                           #ISP identifier 
        set phone 080989999                       #ISP's dial number
        set authname telkomnet@instant      #Your username
        set authkey telkom                            #your Password 
        set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0     #this only for Dynamic IP address
        add default HISADDR                         # Add a default route

        ISP2:                                              #if you have your 2nd ISP  
        set phone 123456789 
        set authname xxxxxxxxxxxxxxxx
        set authkey xxxxxx  
        set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
        add default HISADDR 

        #END

The PPP.conf file above assumes that we have two ISPs , so just decide which ISP we want to dial. Then simply execute ppp -auto telkom  or  ppp -auto ISP2  ( automatic mode ), we also enable dial in interactive mode. For fully PPP tutorial see  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ppp-and-slip.html

Don't forget to put your ISP`s DNS in your resolv.conf file :

#resolv.conf.sample
nameserver 202.134.0.155
nameserver 202.134.2.5

It's great idea to resync the ipf current list in the kernel each time ppp make a connection, and I always unload the ipnat.rules when ppp closes connection. So I put some commands in the ppp.linkup and ppp.linkdown in /etc/ppp/  or you can create them both by yourself. Here is the samples :

#PPP.LINKUP
telkom:
!bg /sbin/ipnat -f /etc/ipnat.rules   #this will load ipnat.rules when connected,so you dont need to load ipnat from rc.local.
!bg /sbin/ipf -y                             #this will resync ipf rules                                    
#end of ppp.linkup

#PPP.LINKDOWN
telkom:
!bg /sbin/ipf -y
!bg /sbin/ipnat -f /etc/ipnat -CF        #this will flush ipnat.rules when disconnected.
#end of ppp.linkdown

Happy surfing ,, now .. :)) 

G-net Pekalongan, June 2002 by esteh

Back to INDEX