RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
linux命令行拨号上网,linux怎么拨号

如何用 Linux 拨号上网

linux拨号上网可以使用pppoe这个拨号上网工具,然后再用这个工具进行设置。

创新互联公司是一家专业提供吴江企业网站建设,专注与成都网站设计、成都做网站、H5页面制作、小程序制作等业务。10年已为吴江众多企业、政府机构等服务。创新互联专业网站建设公司优惠进行中。

一般来说,现在的linux系统,都提供比较好的x界面,可以方便的进行上网。

Linux 系统怎么用电信宽带拨号上网

(1)安装的前提条件

1确保安装了网卡并工作正常

使用命令

#ifconfig eth0

查看网卡状态

2在系统中不要设置默认路由(网关),让ADSL拨号后自动获得

如果已经设置了默认路由,使用以下方法删除:

在文件 /etc/sysconfig/network/ifconfig-eth0 中删除 GATEWAY= 这一行,然后以root执行:

# service network restart

3已经安装了pppd软件包

如果存在文件 /usr/sbin/pppd,则说明已经安装了pppd; 如果未安装,下载安装这个软件包。

(2)安装PPPOE客户端软件

Linux下的PPPOE客户端软件比较多,而且大多使用GNU License,我们推荐使用rp-pppoe

这个软件包。从这个网站上,不仅可以下载

各发布包下的rp-pppoe的二进制软件包,而且可以下载源代码软件包。

我们使用centos下的yum安装方法,来安装rp-pppoe软件包

#yum install rp-pppoe

(3)配置PPPOE客户端软件

1配置文件

安装完软件包后,必须配置PPPOE的配置文件/etc/ppp/pppoe.conf,从而让ADSL拨号时使用配置文件中的用户名、密码等参数。

2命令配置

# adsl-setup ← 建立ADSL连接

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 root): ← 填入ADSL连接的用户名

INTERFACE

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): ← 直接按回车,接受默认设置

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服务器的信息在此填入。不知道的情况按回车跳过

PASSWORD

Please enter your Password: ← 输入ADSL的连接密码

Please re-enter your Password: ← 再次确认输入ADSL的连接密码

USERCTRL

Please enter 'yes' (two letters, lower-case.) if you want to allow

normal user to start or stop DSL connection (default yes): no ← 填入no,不允许一般用户控制PPPoE的连接

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 ← 输入0,不在这里使用防火墙

Start this connection at boot time

Do you want to start this connection at boot time?

Please enter no or yes (default no): yes ← 填入yes,在系统启动时自动连接ADSL

** Summary of what you entered **

Ethernet Interface: eth0

User name: caun870293@ca.dti.ne.jp

Activate-on-demand: No

DNS: Do not adjust

Firewalling: NONE

User Control: no

Accept these settings and adjust configuration files (y/n)? y ← 配置信息确认无误后,键入y同意设置

Adjusting /etc/sysconfig/network-scripts/ifcfg-ppp0

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.

(4)启动PPPOE客户端软件

# adsl-start ← 启动ADSL连接

# ← 稍等片刻后若启动成功后出现提示符(无任何提示或Connected意味着连接成功)

如果不成功,请检查网线、ADSL MODEM等物理设备,并查看 /var/log/messages中的信息

/usr/sbin/adsl-stop 关闭和ISP的连接

/usr/sbin/adsl-status 查看当前连接的状态

如果想在Linux系统启动时自动启动ADSL连接,输入以下命令

#chkconfig --add adsl

将在当前的运行级下加入ADSL的自启动脚本

(5)测试

当连接成功后,使用命令 #ifconfig -a 在输出中应该含有关于 ppp0 的一堆信息,其中还绑定了 IP 地址,说明已经从拨号中获 得了IP地址。使用命令 #netstat -nr 查看路由表信息,这时的默认路由应该是上面获得的IP地址。 如果没有默认路由,我们可以手动增加: #route add default gw 上面获得的IP地址使用命令#nslookup 如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器最后,使用命令ping某个域名或IP,如果有响应,表示你已经大功告成了。

linux下命令行如何配置蓝牙拨号上网(linux高手进)

1,开启手机蓝牙

2,运行hcitool scan,找到自己的手机,记住蓝牙地址

3,sdptool browser 并将输出导入文件中。

4,找到sdptool输出中的Service Name: Dial-up Networking

其中有Channel:记住这个数字,比如,我的是4.

5,编辑/etc/bluetooth/rfcomm.conf,填写:

rfcomm0 {

bind yes;

device 蓝牙地址;

channel 上面的rfcomm Channel;

comment "Phone Dun Connection";

}

6,重新启动bluetooth服务,/etc/rc.d/init.d/bluetooth restart

###############配置kppp######################

7,配置kppp帐号

a,在主界面,点击"配置"

b,在"帐户"页,点击"新建",选择"手工设置",会弹出一个对话框

c,在"拨号"页,"连接名称",随便填写,比如GPRS,然后点"添加",填入电话号码"*99***1#"

d,点击确定,完成配置。

8,配置"调制解调器"

a,切换到"调制解调器"页,选择"新建"

b,调制解调器名称随便填写,比如Phone.

c,设备选择为/dev/rfcomm0

d,确定

9,拨号,直接在主界面点击"连接"即可。

###################配置wvdial##################

将以下内容写入/etc/wvdial.conf

[Dialer gprs]

Modem = /dev/rfcomm0

Phone = *99***1#

Username = cmnet

Password = cmnet

然后,wvdial gprs即可。

他不会自动更新/etc/resolv.conf,可以把/var/run/ppp/resolv.conf拷贝到/etc

linux系统下怎样进行拨号上网?

输入:sudo pppoeconf

pppoeconf 会先侦测你哪一张网络卡连接到ISP。他会列出所有侦测到的网络接口并询问你他是否已找到所有网络接口:

如果没有找到网络接口或你计算机际实的网络接口比他找到的还要多,你最好检查有否加载适当的核心模组(Kernel module)。如果正确,请按『是』(Yes)。

如果你以前曾经执行 pppoeconf,可能会遗留一些旧配置。pppoeconf 会问你要不要复盖旧配置。

请输入用户名称。然后当然是问你登入密码:

请输入密码。

接着会问你使否使用网络商提供的域名服务器(DNS Server):

请按『是』(Yes) 。

跟着问是否要把 MSS 限制不大于1452字节。

请按『是』(Yes) 。

现在 PPPoE 的基本设定已搞好了。但 pppoeconf 仍会问你每次启动计算机时是否需要自动连接 Internet:

请按『是』(Yes) 。

最好问你现在是否需要立刻连接 Internet:

请按『是』(Yes) 。

一切都搞定了,现在你可以在网上畅游了。

启动连线 (pon dsl-provider)

完成后,你随时可以打以下指令连接上网:

pon dsl-provider

中断连线 (poff)

亦可以打以下指令中断连线:

poff

sudo pppoeconf 设置完后

要手工拨号上网,打开终端,输入命令:sudo pon dsl-provider

打开/etc/ppp/peers/dsl-provider后,手工加了一行password ****的记录后,下次就自动连接了。

手工断线的命令:sudo poff

查看连接情况的命令:plog 和 ifconfig ppp0

深度linux系统怎么拨号上网

殊不知,在Linux下的拨号上网,甚至比Windows下的更简单一些,我们一样可以指点江山:在Linux下要实现拨号上网,首先你的系统内核必须支持ppp,另外还必须有支持ppp的软件 ,编译内核虽然并不是太难,但对于我们来说也并不简单,值得庆幸的是,现在的大多数Linux发行套件都在内核上支持了ppp。至于ppp软件象KDE的kpppd和RedHat发行套件里面都有,下面我们就以现在十分流行的Mandrake(基于RedHat的一种发行套件)来实现我们的Linux下的上网梦。其实Linux对Modem的要求比Windows低得多,几乎所有的modem一接上就能用,连猫的驱动程序都不用安装!Gnome环境拨号单击左下角的大脚按钮(是不是和Windows98下的[开始]按钮有点相似呢?),在弹出菜单中选择System→ControlPanel,就打开了RedHat的控制面板。打开控制面板上的ModemConfiguration(你只要将鼠标在某个按钮上边停留几分钟,就会有提示该按钮的用途),在这里要做的事情极其简单,仅仅是选择你的猫所连接的端口,Linux下串口设备文件的命名和DOS的关系如下:DOSCOM1=Linux/dev/cua0(and/dev/ttyS0)DOSCOM2=Linux/dev/cua1(and/dev/ttyS1)一般来说/dev/cua*是用来拨出的,/dev/ttys*是用来拨入的,但现在好像已经不再区分。笔者的Modem接在COM1上,所以选择/dev/cua0,按OK按钮确定。单击控制面板上ModemConfiguration按钮上方的NetworkConfiguration按钮,选择Interface标签页,此时由于还没有添加Modem,我们只可以看到lo和eth0两个网络界面,单击Add添加网络界面,在接着出现的InterfaceType窗口中选择PPP连接方式,并按OK确定。然后吗?和瘟酒吧下的就十分相似了,在CreatePPPInterface窗口中的PhoneNumber中添上你的ISP的电话号码(比如163),在PPPloginName中添上用户名称,在PPPpassword中添上密码即可。开始尝试拨号吧!单击大脚按钮,选择AnotherLevelmenu,再选择其中的Networking,打开Usernet,可以见到到一个状态栏窗口,ppp0就是Modem的状态,红色代表未接通。单击ppp0开始拨号,状态变成黄色,表示使用中;一阵熟悉的的拨号声后,状态变成了了绿色,表示接通了。打开你的浏览器开始周游世界吧!只要再单击一下ppp0就可以断开连接了。上面已经将拨号上网在Gnome下成功地安好了。对于Linux初学者来说依葫芦画瓢便能学会,真是非常的实用。KDE下拨号KDE下的拨号需要用到kppp这个程序,如果你在安装KDE的时候安装了kdenetwork这个rpm包,你就已经安装好了kppp,kppp的界面比前面的Usernet要漂亮的多,而且功能更加强大,下面我们只介绍一下它的基本使用方式:和Gnome环境下类似,单击左下脚的大K→Internet→kppp就打开了kppp拨号程序,此时你面前出现的是一个空空的窗口,单击Setup,在kpppConfiguration窗口中选择Device标签页,在其中的ModemDevice中选择Modem连接的端口/dev/cua0,当然你可以在命令行执行ln/dev/modem/dev/cua0,然后你就可以在这里选择/dev/modem了,在ConnectionSpeed中选择你的连接速率。选择Accounts标签页,单击New建立新的账号,ConnectionName中输入连接名,PhoneNumber中输入你的ISP的电话号码,选择DNS标签页,在DNSIPAddress中输入你的ISP的IP地址,单击Add添加,OK确定退出。现在一切都已经设定好了,你又退回到了kppp登录窗口,输入你的账号(LoginID)和密码(Password),然后单击connect就开始登录网络了。需要断线?在连接窗口中,单击Disconnect即可。Linux下的拔号程序比起Windows下的拨号程序也毫不逊色,而且设定还更简单,看谁以后敢说Linux下的拨号程序很难用,而且界面丑陋。

linux下如何实行ADSL拨号上网?

1 首先,你必须安装相应的ADSL拨号软件。平常用的redhat发行版本中,带有pppoe这个rpm包。

我们通过下面的命令实现:

[root@Server root]# rpm -qa|grep pppoe

rp-pppoe-3.4-7

这个命令的输出来确定系统中是否已经安装了pppoe这个包。rpm -qa是列出系统中已经安装的包。通过管道|将这个命令的输出,作为第二个命令的输入。grep pppoe是列出包含有pppoe的行。如果返回为空,则说明没有安装。如果安装了,会返回安装了pppoe的版本号。如果你还没有安装的话,通过下面的命令安装。

[root@Server root]# rpm -ivh redhat/ppp-2.4.1-7.i386.rpm

这样,你就安装好了拨号需要的软件。

2 配置网卡

拨号需要将拨号的网卡设置为动态获取ip。而动态获取ip在机器启动的时候,将会花费很长时间去获取ip。所以,我们最好将网卡设置不启动时不激活。(不建议这么做,如果是远程登陆的话,就很麻烦)一般情况下我们都使用命令netconfig可以方面的配置网络相关信息。当然,也可以通过修改网卡的配置文件实现:

[root@Server root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

3 配置拨号软件

与ADSL相关的一共有四个命令adsl-connect ,adsl-setup,adsl-start,adsl-status,adsl-stop

通过下面这个命令,启动ADSL设置:

[root@Server root]# 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 root):

接着,要求我们选择使用的网络接口。我们这时候,填入我们刚刚设置的那个网卡。对于大多数只有一个网卡的朋友而言,默认eth0就可以了。

INTERFACE

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):

接下来,询问的是,adsl连接以后,是否持续保持连接。或者是自动的断开,在指定的时间(以秒数计算)内。多数情况下,我们希望手动的打开关闭连接。所以这里选择默认的no。

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了。我发现很多时候,pppoe都不能够正确获取dns信息。我建议你输入dns地址。这些信息在isp的网站上一般都有公布。

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.

帐号密码是必须,输入两次。密码显示风格和其他的地方一样,不显示在屏幕上。这个,我不知道改怎么填写。太高深的问题了。希望你将你的答案和我分享。:P。

PASSWORD

Please enter your Password:

Please re-enter your Password:

下面的设置,是表示是否允许普通用户启用/关闭 ADSL连接。默认是允许。

Please enter 'yes' (two letters, lower-case.) if you want to allow

normal user to start or stop DSL connection (default yes):

我们看下防火墙选项。这里提供的防火墙可以给你提供基本的安全保护。我不推荐你使用——你最好选择“NONE”选项。无论是什么样的用户使用,我都建议你使用额外的工具来配置防火墙规则(iptables目前看来是一个非常不错的工具)。

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):

是否在开机时,打开这个连接?

Do you want to start this connection at boot time?

所有的配置信息填写完成之后,系统将给出一个报告,完整的显示出你输入的配置信息。如果,你确信你输入的配置信息是正确的,输入yes写入配置文件。输入no放弃配置。

Summary of what you entered

Ethernet Interface: eth0

User name: root

Activate-on-demand: No

DNS: Do not adjust

Firewalling: NONE

User Control: yes

Accept these settings and adjust configuration files (y/n)?

Please enter no or yes (default no):

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.

测试拨号

现在,我们需要测试下我们的拨号是否配置正确了。

输入ADSL-start拨号。一般情况下,我会ping 我的ISP的主WWW服务器。比如

ping 61.139.2.69(该地址是电信的DNS服务器)

如果能ping通则说明没有什么问题

如果不怕麻烦,打开浏览器测试下,也可以。如果一切ok。那么我们就可以结束我们的配置了。

当然,你关闭连接的话,使用命令adsl-stop就可以了。

来源:() - 如何在Linux下用ADSL拨号上网_下雨天看星星_新浪博客

故障排除

照上边的操作步骤配置下来,一般是没有什么问题的。但是因为Linux没有Windows那么直观,出现问题的话,排除故障是非常恼火的。

故障1:无法浏览网页,但是可以ping通DNS服务器地址,多半是在配置的时候DNS服务器地址填错了。建议检查一下DNS服务器是否正确。

故障2:用ifconfig查看链接,确实出现了三个链接,一个eth0,一个lo,一个ppp0,但是就是无法ping通外网,这种情况多出现在手动修改ifcfg-eth0文件,或者用netconfig命令的情况下。

我查看了一下我Windows下和Linux下的路由信息发现少了如下路由,

Network Destination Netmask Gateway Interface

0.0.0.0 0.0.0.0 192.168.0.77 192.168.0.77 1

注释: 192.168.0.77 是我windows拨号取得的PPPOE客户端地址,这条路由的意思是所有的数据包都从77这个端口出去,但是Linux下就没有这条路由。

后来查了很多资料终于找到了问题所在,因为我的eth0网址信息是我手动修改的,所以就有GATEWAY这一项, 而且我发现路由都是从192.168.0.1这个端口出去的,而我PPP0E客户端拨号获得的地址是192.168.0.76,所以这肯定是不对的,怎么解决呢?

将/etc/sysconfig/network文件中的GATEWAY一项用#号注释掉,

将/etc/sysconfig/network-scipts/ifcfg-eth0文件中的GATEWAY也注释掉,

重启拨号


标题名称:linux命令行拨号上网,linux怎么拨号
分享链接:http://sczitong.cn/article/hopdii.html