Debian的ADSL上网配置

本文介绍了Debian系统PPPoE拨号上网的配置与测试方法。先将网卡配置为Static类型,安装rp - pppoe,配置re - pppoe,包括输入用户名、密码、DNS等信息。接着使用pppoe - start等命令进行拨号操作,最后通过检查端口信息、路由表、DNS解析及ping命令进行测试。
部署运行你感兴趣的模型镜像
装好系统后会默认网卡是DHCP配置网络

(1)编辑/etc/network/interfaces

# 启动系统激活设备.
# Loop回环地址.
auto lo
iface lo inet loopback

# 启动系统激活设备.
# 网卡eth0设置为Static类型.
auto eth0
iface eth0 inet static

# 指定IP地址.子网掩码.广播.网关.
address 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
#
不要设置网关,这个害得我弄了一个星期都搞不定
#
在系统中不要设置默认路由(网关),让ADSL拨号后自动获得
#gateway 192.168.0.1

(2)安装 rp-pppoe
下载最新的版本
解压到/usr/src
然后进到解压后的目录的/src中
#./configure --prefix=/usr/local
#make;make install
安装完成

(3)配置re-pppoe
#pppoe-setup
使挂载的fat32和ntfs分区正常显示中文名
自动加载方式:

编辑/etc/fstab文件,把原来的

/dev/hdb1 /mnt/hda2 vfat auto,umask=0 0 0                  
/dev/hdb5 /mnt/hda5 vfat auto,umask=0 0 0

      改成

/dev/hdb1 /mnt/win_1 vfat iocharset=gb2312,umask=0 0 0
/dev/hdb5 /mnt/win_2 vfat iocharset=gb2312,umask=0 0 0

yemy:/usr/src/rp-pppoe-3.6/src# /usr/local/sbin/pppoe-setup
Welcome to the Roaring Penguin PPPoE client setup.  First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good!  Now, please enter some information:

USER NAME
#输入ADSL帐号的用户名
>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): abcdefg(用户名)

INTERFACE
#ADSL相连的网卡的名字
>>> Enter the Ethernet interface connected to the DSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0): eth0
#demand value不用输入
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):

DNS
#DNS服务器的IP,两个
Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide 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: *.*.*.*
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: *.*.*.*

PASSWORD
#密码
>>> Please enter your PPPoE password:
>>> Please re-enter your PPPoE password:

FIREWALLING
#防火墙,设为0
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

** Summary of what you entered **

Ethernet Interface: eth0
User name:          abcdefg(用户名)
Activate-on-demand: No
Primary DNS:        *.*.*.*
Secondary DNS:      *.*.*.*
Firewalling:        NONE
#信息正确,输入 y ,完成配置,否则,输入 n 重新输入。
>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
  (But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
  (But first backing it up to /etc/ppp/pap-secrets-bak)
  (But first backing it up to /etc/ppp/chap-secrets-bak)



Congratulations, it should be all set up!

Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down.  Type 'pppoe-status' to see the link status.

(4)使用pppoe拨号
启动
#pppoe-start
#.Connected!(连接上)
停止
#pppoe-stop
状态
#pppoe-status

(5)测试
检查是否存在ppp0端口和其信息
#ifconfig -a
ppp0      Link encap:Point-to-Point Protocol
          inet addr:222.216.23.142  P-t-P:172.0.0.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:8875 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8766 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:5545934 (5.2 MiB)  TX bytes:1101231 (1.0 MiB)

查看路由表信息
#netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
172.0.0.1       0.0.0.0         255.255.255.255 UH        0 0          0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         172.0.0.1       0.0.0.0         UG        0 0          0 ppp0

 
如果没有默认路由,可以手动增加:
#route add default gw 上面获得的IP地址


如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器
#nslookup www.sina.com.cn

最后,使用命令ping某个域名或IP,如果有响应,表示已经大功告成。
555555555~~~~~全世界上网!

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

<think>好的,用户想了解如何在Linux系统上配置ADSL拨号上网。我需要先回顾之前提供的引用内容,确保信息准确。引用中提到需要安装pppoe软件包,然后用adsl-setup工具配置/etc/ppp/pppoe.conf文件。这应该是关键步骤。 首先,用户可能需要安装必要的软件包,比如rp-pppoe。不同Linux发行版的安装命令可能不同,比如Debian系用apt,Red Hat系用yum或dnf。需要分别说明清楚,避免混淆。 接下来是配置部分,使用adsl-setup命令。这里要详细列出每一步的选项,比如输入用户名、选择网卡、是否保持在线等。用户可能对网络接口名称不太熟悉,需要提醒他们用ip a命令查看。 然后是启动和断开连接的指令,adsl-start和adsl-stop,以及查看状态的adsl-status。这部分操作比较基础,但需要明确写出命令,方便用户复制粘贴。 此外,故障排查也很重要。常见的如密码错误、网卡选择错误,需要指导用户检查日志,比如/var/log/messages。可能还需要提到防火墙设置,或者路由配置是否正确。 用户可能需要设置开机自动连接,可以建议将adsl-start加入启动脚本,或者配置为服务。不同发行版的服务管理工具不同,比如systemctl,需要适当说明。 最后,生成的相关问题要覆盖配置步骤、常见错误、自动连接和安全性等方面,帮助用户进一步探索。确保每个问题都能在之前的步骤中找到线索,或者引导他们查找更多资料。 要检查是否遗漏了任何关键步骤,比如配置文件的手动修改是否必要,或者是否有其他工具可用。确保语言简洁明了,避免专业术语过多,让新手也能理解。同时,注意格式要求,行内公式用$...$,但这里可能用不上,主要关注代码块和引用标识的正确使用。</think>### Linux系统ADSL拨号配置指南 #### 一、前期准备 1. 确认已安装PPPoE客户端 - Debian/Ubuntu系统:`sudo apt install pppoeconf rp-pppoe` - Red Hat/CentOS系统:`sudo yum install rp-pppoe` - 验证安装:`which adsl-setup`[^1] 2. 获取网络接口名称 ```bash ip a | grep "state UP" ``` #### 二、配置流程 1. 启动配置向导 ```bash sudo adsl-setup ``` 2. 逐步配置参数: - 输入ADSL用户名(格式:user@provider) - 选择以太网接口(如eth0) - 设置防火墙规则(建议选择STANDALONE) - 确认"no"保持持续连接 - 输入服务商提供的密码 3. 配置文件示例: ```bash ETH=eth0 USER=user@adslprovider DEMAND=no ``` #### 三、连接控制 1. 启动ADSL连接 ```bash sudo adsl-start ``` 2. 查看连接状态 ```bash adsl-status ``` 3. 断开连接 ```bash sudo adsl-stop ``` #### 四、故障排查 1. 查看详细日志 ```bash tail -f /var/log/messages ``` 2. 常见错误处理: - 错误691:检查用户名/密码 - 超时问题:确认网线连接 - 接口错误:验证`ETH`参数
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值