Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->系统管理 ->正文

Linux拨号服务快速指南

来源:Linux-cn.com 作者:Webmaster 时间:2007-05-05 点击: [收藏] [投稿]

  然后根据你的ISP作出相应的改动,比如ppp-on和ppp-on-dialer两个可执行文件:

  ppp-on文件:只需要看我加入中文说明的地方


#!/bin/sh 
# 
# Script to initiate a ppp connection. This is the first part of the 
# pair of scripts. This is not a secure pair of scr ipts as the codes 
# are visible with the'ps' command. However, it is simple. 
# 
# These are the parameters. Change as needed. 
TELEPHONE=32768 # ISP提供的上网电话号码 
ACCOUNT=ynguo #账号名称 
PASSWORD=faintyou #登录密码,注意修改本文件权限以便保密 
LOCAL_IP=0.0.0.0 #本地IP地址,0.0.0.0表示由ISP动态分配 
REMOTE_IP=0.0.0.0 #远端IP地址,一般为0.0.0.0 
NETMASK=255.255.255.0 #子网掩码地址 
# 
# Export them so that they will be available at'ppp -on-dialer' time. 
export TELEPHONE ACCOUNT PASSWORD 
# 
# This is the location of the script which dials th e phone and logs 
# in. Please use the absolute file name as the$PATH variable is not 
# used on the connect option.(To do so on a'root' a ccount would be 
# a security hole so don't ask.) 
# 
DIALER_SCRIPT=/etc/ppp/ppp-on-dialer 
# 
# Initiate the connection 
# 
# I put most of the common options on this command. Please, don't 
# forget the'lock' option or some programs such as mgetty will not 
# work. The asyncmap and escape will permit the PPP link to work with 
# a telnet or rlogin connection. You are welcome to make any changes 
# as desired. Don't use the'defaultroute' option if you currently 
# have a default route to an ethernet gateway. 
# 
exec/usr/sbin/pppd debug lock modem crtscts/dev/tty S1115200 
asyncmap20A0000 escape FF kdebug0$LOCAL_IP:$REMOTE_ IP 
noipdefault netmask$NETMASK defaultroute connect$DI ALER_SCRIPT& 

  ppp-on-dialer文件:


#!/bin/sh 
  # 
  # This is part2 of the ppp-on script. It will perform the connection 
  # protocol for the desired connection. 
  # 
  exec chat-v 
  TIMEOUT3 
  ABORT’
BUSY
’ 
  ABORT’
NO ANSWER
’ 
  ABORT’
RINGING
RINGING
’ 
  ’’ 
AT 
  ’OK-+++c-OK’ ATH0 
  TIMEOUT30 
  OK ATDT$TELEPHONE 
  CONNECT’’ 
  username:--username:$ACCOUNT 
password:$PASSWORD 

  需要注意的是,在ppp-on脚本的最后一行用exec启动pppd的参数中,/dev/ttyS1代表modem连结在COM2口上,115200表示modem的速率,可以根据实际情况进行修改;此外,如果ISP提供的拨号提示不是username,而是login的话,需要将ppp-on-dialer中的username改为login (即把username和login去掉第一个字母)。

  3.配置域名服务器

  编辑/etc/resolv.conf文件,加入ISP提供的域名服务器的IP地址。例如:


search ustc.edu.cn
nameserver 202.38.64.1

  4.拨号上网

  上述准备工作完成之后,以root权限登录,开启Modem,运行ppp-on,该脚本将负责拨号、送出登录信息并完成协议验证,当看到Modem上的数据指示灯停止闪烁并保持连接状态的话,ppp就已经连接成功了。你可以用 netstat -r查看路由表或者pppstats检查ppp的状态,也可以通过Ping你的ISP,或者直接启动Netscape浏览器来检查,如果一切正常的话,那么你的Linux已经连接到Internet了。




 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<

上一页 1 2下一页


上一篇:理解IDS的主动响应机制   下一篇:ProFtpd快速指南

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
·Motorola微处理器bootloader分析与应用
·Fedora Core5 NFS服务器搭建过程介绍
·Linux系统:让内存不再泄漏的实用技巧
·新手看招 手把手教你安装VMware虚拟机
·“侵权事件” 红帽称微软企图干扰用户
·删除Linux后 如何找回Windows启动菜单
·菜鸟乐园 Linux中常见文件系统格式介绍
·Linux操作系统下IPTables配置方法详解
·实用技巧 Linux系统的经典使用技巧八则
·Linux系统文件优化及磁盘检查方法介绍
推荐文章
·用 vi 多行注释
·一个网上理财站点的设计(九)
·[显卡]如何驱动SAVAGE3D显卡?
·Linux内核开发者的实用技巧两则
·简易防火墙建置与流量统计之四
·用户管理(下)
·如何从技术上选择中间件
·LVS集群系统网络核心原理分析
精彩文章
·LILO使用指南(下)
·Linux应用问答
·[人物]KDE英雄(12):Matthias Elter
·利用RTLinux开发嵌入式应用程序
·你的第一个Java(for UNIX(Linux))
·PGP 简介
·增强Sendmail的抗DoS攻击能力
·Oracle Developer/2000一些使用技巧
·用PHP和MySQL构建一个数据库驱动的
·走进Java原型开发
·Samba使用大全(一)-samba服务器
·用语言控制Linux:Linux的语音识别
·RedHat源码升级-(OpenSSL + OpenSS
·如何修改登录画面?
·aide使用手册
·一个网上理财站点的设计(三)
·Linux邮件服务器软件比较
·文件的存取权限—模式位疑难详解
·用JSP/ASP创建WAP应用
·Java入门(13) More Java!
·如何在Linux下用DMA的方式进行数据
·linux汉化大全(三)
·Linux组网入门(6):代理服务器
·Apache性能提示
·IBM DB2 :蓝色巨人遭遇开放源代码
·设置一个高容量的Linux POP3服务器
Power by linux-cn.com 粤ICP备05006655号