linux 下设置ADSL宽带连接

以下配置必须有root权限,或在终端中输入su和管理员密码取得临时root权限:
1    设置一块网卡的IP为空。
    如下:如果你的电脑上的第一块网卡为连接宽带猫的网卡,可以在命令行中使用以下命令。
    # /sbin/ifconfig eth1 0.0.0.0 up
    其中eth1代表电脑上的第二块网卡,如果你的电脑上只有一块网卡就换成eth0。
2    使用如下命令设置宽带信息:
    # /sbin/adsl-setup
    # 终端上会提示以下信息:
    Welcome to the ADSL client setup.  First, I will run some checks on
    your system to make sure the PPPoE client is installed properly...


    LOGIN NAME

    Enter your Login Name (default 你的电脑名称): 这里输入宽带上网帐号。

    # 接着要求设置用哪一个网卡上网
    Enter the Ethernet interface connected to the ADSL modem
    For Solaris, this is likely to be something like /dev/hme0.
    For Linux, it will be ethX, where 'X' is a number.
    (default eth0): 这里输入连接宽带猎的网卡的名称,如果你只有一块网卡只能输入eth0
    # 接着回答连接是否持续工作。
    Do you want the link to come up on demand, or stay up continuously?
    If you want it to come up on demand, enter the idle time in seconds
    after which the link should be dropped.  If you want the link to
    stay up permanently, enter 'no' (two letters, lower-case.)
    NOTE: Demand-activated links do not interact well with dynamic IP
    addresses.  You may have some problems with demand-activated links.
    Enter the demand value (default no): 回答no是永久保持,或设置超时的时间以秒
    为单位,建议为no。
    # 输入DNS信息,请从供应商那索取,或打电话咨询。
    DNS

    Please enter the IP address of your ISP's primary DNS server.
    If your ISP claims that 'the server will provide dynamic DNS addresses',
    enter 'server' (all lower-case) here.
    If you just press enter, I will assume you know what you are
    doing and not modify your DNS setup.
    Enter the DNS information here: 这里输入电信或其他供应商提供的DNS地址
    Please enter the IP address of your ISP's secondary DNS server.
    If you just press enter, I will assume there is only one DNS server.
    Enter the secondary DNS server address here: 这里输入备用DNS
    # 输入上网密码
    PASSWORD

Please enter your Password: 这里输入上网密码
Please re-enter your Password: 确认输入一次
# 是否手动启动连接
USERCTRL

Please enter 'yes' (three letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes): “yes“ 为手动,
no为自动

FIREWALLING

Please choose the firewall rules to use.  Note that these rules are
very basic.  You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security.  If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself.  Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc.  If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules.  You are responsible
          for ensuring the security of your machine.  You are STRONGLY
          recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
                for a LAN
Choose a type of firewall (0-2): 选择防火墙,0-不用,1-标准(建议使用),2-如果本机
作为网关时使用。

Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no):是否启动电脑时连接,yes(启动时连接),no(启动时
不连接)
# 以下是你设置的连接的总结。
** Summary of what you entered **

Ethernet Interface: eth1
User name:          gjl2006yn
Activate-on-demand: No
Primary DNS:        202.98.161.68
Secondary DNS:      202.98.160.68
Firewalling:        STANDALONE
User Control:       yes
Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting /etc/resolv.conf
Adjusting /etc/ppp/chap-secrets and /etc/ppp/pap-secrets
  (But first backing it up to /etc/ppp/chap-secrets.bak)
  (But first backing it up to /etc/ppp/pap-secrets.bak)



Congratulations, it should be all set up!

Type '/sbin/ifup ppp0' to bring up your xDSL link and '/sbin/ifdown ppp0'
to bring it down.
Type '/sbin/adsl-status /etc/sysconfig/network-scripts/ifcfg-ppp0'
to see the link status.
# 以上配置好之后,每次上网时使用以下命令启动宽带连接。
    # /sbin/adsl-start
# 如果想下线,使用以下命令。
    # /sbin/adsl-stop
# 以上这些配置以及取得连接都在root权限下使用。




 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值