
正文
linux设置拨号命令 linux adsl拨号
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
linux如何拨号上网
Linux系统有好多种类,像我们经常碰到的centos、ubuntu或redhat;有的系统是有操作界面的,有的直接是命令模式,命令模式的适合做服务器,大家都知道Linux系统安全性比较高,所以在网络上的运用也是相当的广泛。
linux如何拨号上网
当然有界面的设置更加方便,那么没界面的系统只能从配置文件中修改,我就把从配置文件中设置拨号上网的方式呈现下。
不管有没有界面操作,此配置都可以使用,大家知道Linux系统查看文件的命令有很多,只要目录才是关键,通过more /etc/sysconfig/network-scripts/ifcfg-ppp0 命令跟目录的方式知道系统文件下进行对pppoe拨号账号设置具体方式参考下图。
为了提高安全性。密码放置在sysconfig文件目录下,密码就放置在密码文件。密码放置的目录在/etc/ppp/下,从下图我们就可以看到需要pap和chap验证的2个文件。
找到目录我们就进入设置密码,我们可以看到账号和密码都是以“”表示隔开。大家在设置账号密码的时候记得两个文件都需要更改。
修改了配置文件就不需要图形界面的配置了;
更改配置文件的命令是vi,通常我们说的是vi编辑器就是这个,通过vi编辑器修改里面的配置。
有的朋友对于编辑器不太熟悉,狂用ctrl+c,+v,+z但是都是行不通,Linux下退出编辑器的命令是:q表示直接退出不保存;如果需要保存那么就:wq,意思是write quit的意思,保存退出。
完成设置后我们可以在命令行下ping下域名或网络地址即可,或者我们再看下ip获取情况,我们看到获取到了一个正常的公网地址,然后也可以ping通百度网站,说明网络已经连接,恭喜可以正常上网了。
相关问答
Q1: linux下有什么比较方便的ADSL拨号命令么
[root@sample ~]# 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 a href="" class='replace_word' title="Linux知识库" target='_blank' style='color:#df3434; font-weight:bold;'Linux/a, 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.
然后,启动ADSL连接。
[root@sample ~]# adsl-start ← 启动ADSL连接
[root@sample ~]# ← 稍等片刻后若启动成功后出现提示符(无任何提示即意味着连接成功)
Q2: 请问LINUX下如何设置ADSL拨号?
直接使用adsl-setup设置,adsl-start连接 端口重定向; 1、 网卡配置。 两块网卡linux设置拨号命令,eth0为拨号网卡linux设置拨号命令,IPlinux设置拨号命令:192.168.1.1(其linux设置拨号命令他的地址也可);eth1为内网网卡,IP:192.168.0.1。掩码均为255.255.255.0。 局域网网段为192.168.0.0。 注意:此处两块网卡均不能设网关。 2、 PPPoE软件的升级与安装 1) 在 (REDHAT默认安装已安装上) 下载 2) 安装rp-pppoe。以root身份执行 rpm -Uvh rp-pppoe-3.5-1.i386.rpm 3、 修改/etc/ sysctl.conf 将其中的 net.ipv4.ip_forward = 0 改为 net.ipv4.ip_forward = 1 4、 去除ipchains模块,只选择iptables方法如下: 1)setup 2)选择system service 3)去除ipchains 4)选中iptables 5)重启机器 5、 PPPoE客户端配置 在rp-pppoe-3.5-1.i386.rpm安装完毕后,接下来就可进行PPPoE客户端配置了。过程如下。 #/usr/sbin/adsl-setup ;;; Enter your PPPoE user name: --此处输入拨号帐号的用户名 ;;; 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 ethn, where n is a number. (default eth0): --输eth0 ;;; Enter the demand value (default no): --输no ;;; Enter the DNS information here: --输210.52.149.2(视当地运营商的DNS服务器IP而定) ;;; Please enter your PPPoE password: --输网通用户口令 ;;; Choose a type of firewall (0-2): --输0 (0代表无防火墙,防火墙就用IPTABLES去吧) ;;; Accept these settings and adjust configuration files (y/n)? --输y 6、 启动拨号连接 /usr/sbin/adsl-start 成功连接后,屏幕显示Connected。 此时这台linux已可以上网浏览了。 7、 IP伪装 为了使局域网中的其他机器能通过Linux服务器共享上网,至少须执行下面的命令: iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 完成后,在192.168.0.0网段(网关为192.168.0.1)的PC机就可透过Linux上网了! 8、 开机自启动 为了使Linux服务器能够自动拨号,执行下面步骤。 1)chkconfig --add adsl 2)setup 3)选择system services 4)选中ADSL 5)OK退出 6)打开/etc/rc.d/rc.local,在该文件的末尾添上下面语句 echo "[OK]" echo "Drop ICMP form anywhere" echo 1 ; /proc/sys/net/ipv4/icmp_echo_ignore_all echo "[OK]" iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 说明:前面四句用于关闭ICMP,防止别人Ping。
Q3: linux 怎么设置拨号连接``
linux上网设置经典二法
1、一种是linux共享局域网内的windows主机上网
如果你的网卡linux能够识别的话在安装的时候会有网卡配置过程。从列表中选择网络设备,一般为eth0,点击“编辑”,在打开的“编辑接口”对话框中,用户可以通过DHCP来配置网络,这样也可以,不过我更喜欢定制一个静态IP,所以去掉“使用DHCP进行配置”前面的选项,然后在下面输入你要定制的IP地址和子网掩码,确定后,在下面的网关和主要DNS里输入当前局域网上做为主机的计算机的IP地址。这样装完以后就搞定。
如果你是装完后再安装的网卡的话,那可以在“系统设置”里选择“网络”,如果你的网卡安装成功的话会在下面的列表里看到你的网卡,同样设置DNS(和上面一样),然后再回到列表里,选中你的网卡,点上面的编辑,选中“当计算机启动时激活设备”,然后选择下面的“静态设置的IP地址”,在下面输入和上面同样的设置。再重新启动就可以了。
2、另外一种就是用你的linux通过ADSL上网了
在linux下就集成着一个ADSL拨号软件,打开终端,在里面输入#adsl-setup,然后进行设置:
LOGIN NAME
Enter your Login Name (default root):(输入你的用户名)
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):(选择网络设备)
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:
Please re-enter your Password:
USERCTRL
Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes):(是否允许普通用户启动、关闭)
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):(选择firewall的规则)
Start this connection at boot time
Do you want to start this connection at boot time?
Please enter no or yes (default no):(选择是否随机启动)
** Summary of what you entered **
Ethernet Interface:
User name:
Activate-on-demand:
DNS addresses:
Firewalling:
User Control:
Accept these settings and adjust configuration files (y/n)?(确认一下是否接受设置)
以上的设置在“系统设置”里 的“网络”里选择新建,建立一个xDSL连接,也可以实现。设置完成了以后在网络里激活连接。
上面的ADSL连接就试过一次,由于我们是局域网,所以一直用的是共享上网,如果有什么错误不要骂我,还请指教!!
linux设置拨号命令的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于linux adsl拨号、linux设置拨号命令的信息别忘了在本站进行查找喔。







