面对网络技术的飞速发展,使得Linux系统用户越来越多。然而,刚开始使用Linux系统的用户们经常碰到一些上网上的问题。下面,我将给大家介绍关于Linux系统上网的解决方案。
首先,要使用Linux系统上网,我们需要检查网卡是否已经安装并启用。如果还没安装,就需要根据电脑的型号安装相应的网卡驱动,然后启动网卡服务,可以使用以下这条命令来启动网卡:
$ sudo ifup eth0
其次,安装网络驱动后,我们还需要检查网络设置是否正确。目前,我们需要手动设置静态IP地址,设置正确的子网掩码、网关等网络参数,使用以下命令来设置网络参数:
$ sudo vi /etc/Network/interfaces
最后,当设置完成后,就可以进行DNS服务的配置,也就是域名解析系统的配置,DNS的设置放在/etc/resolv.conf,可以使用以下命令来设置DNS:

$ sudo vi /etc/resolv.conf
以上便是Linux系统上网问题解决方案,大家可以根据自己的实际情况,按照上述步骤来设置,即可轻松连接网
香港服务器首选树叶云,2H2G首月10元开通。树叶云(shuyeidc.com)提供简单好用,价格厚道的香港/美国云 服务器 和独立服务器。IDC+ISP+ICP资质。ARIN和APNIC会员。成熟技术团队15年行业经验。
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 ISPs 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连接,也可以实现。 设置完成了以后在网络里激活连接。
Linux如何设置上网???
linux上网设置经典二法1、一种是linux共享局域网内的windows主机上网如果你的网卡linux能够识别的话在安装的时候会有网卡配置过程。 从列表中选择网络设备,一般为eth0,点击“编辑”,在打开的“编辑接口”对话框中,用户可以通过DHCP来配置网络,这样也可以,不过我更喜欢定制一个静态IP,所以去掉“使用DHCP进行配置”前面的选项,然后在下面输入你要定制的IP地址和子网掩码,确定后,在下面的网关和主要DNS里输入当前局域网上做为主机的计算机的IP地址。 这样装完以后就搞定。 如果你是装完后再安装的网卡的话,那可以在“系统设置”里选择“网络”,如果你的网卡安装成功的话会在下面的列表里看到你的网卡,同样设置DNS(和上面一样),然后再回到列表里,选中你的网卡,点上面的编辑,选中“当计算机启动时激活设备”,然后选择下面的“静态设置的IP地址”,在下面输入和上面同样的设置。 再重新启动就可以了。 2、另外一种就是用你的linux通过ADSL上网了在linux下就集成着一个ADSL拨号软件,打开终端,在里面输入#adsl-setup,然后进行设置:LOGIN NAMEEnter your Login Name (default root):(输入你的用户名)INTERFACEEnter the Ethernet interface connected to the ADSL modemFor Solaris, this is likely to be something like /dev/ 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 secondsafter which the link should be you want the link tostay up permanently, enter no (two letters, lower-case.)NOTE: Demand-activated links do not interact well with dynamic may have some problems with demand-activated the demand value (default no):(选择是按需拨号,还是持续连接)DNSPlease enter the IP address of your ISPs primary DNS your ISP claims that the server will provide dynamic DNS addresses,enter server (all lower-case) you just press enter, I will assume you know what you aredoing and not modify your DNS the DNS information here:(选择DNS)PASSWORDPlease enter your Password:Please re-enter your Password:USERCTRLPlease enter yes (two letters, lower-case.) if you want to allownormal user to start or stop DSL connection (default yes):(是否允许普通用户启动、关闭)The firewall choices are:0 - NONE: This script will not set any firewall are responsible for ensuring the security of your are STRONGLY recommended to use some kind of firewall rules.1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway for a LANChoose a type of firewall (0-2):(选择firewall的规则)Start this connection at boot timeDo 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的功能越来越强,使用起来也越来越方便,有些朋友除了在硬盘上安装Windows之外,还安装了Linux,可是他们在上网的时候仍然是采用在Windows下拨号上网,Linux下的拨号上网,对于他们来说好像是可望而不可及的事情,这大概是好多朋友看了Linux的帮助文档,对于我们这些在Windows下养成了用鼠标指点江山习惯的懒汉,再要用PPP或者minicom来手工进行命令行设置,真的是有些勉为其难。 殊不知,在Linux下的拨号上网,甚至比Windows下的更简单一些,我们一样可以“指点江山”:在Linux下要实现拨号上网,首先你的系统内核必须支持ppp,另外还必须有支持ppp的软件,编译内核虽然并不是太难,但对于我们来说也并不简单,值得庆幸的是,现在的大多数Linux发行套件都在内核上支持了ppp。 至于ppp软件象KDE的kpppd和Redhat发行套件里面都有,下面我们就以现在十分流行的Mandrake(基于RedHat的一种发行套件)来实现我们的Linux下的“上网梦”。 其实Linux对Modem的要求比Windows低得多,几乎所有的modem一接上就能用,连“猫”的驱动程序都不用安装!Gnome环境拨号单击左下角的“大脚”按钮(是不是和Windows 98下的[开始]按钮有点相似呢?),在弹出菜单中选择“System”→“Control Panel”,就打开了RedHat的控制面板。 打开控制面板上的“Modem Configuration”(你只要将鼠标在某个按钮上边停留几分钟,就会有提示该按钮的用途),在这里要做的事情极其简单,仅仅是选择你的“猫”所连接的端口,Linux下串口设备文件的命名和DOS的关系如下:DOS COM1 = Linux /dev/cua0 (and /dev/ttyS0)DOS COM2 = Linux /dev/cua1 (and /dev/ttyS1)一般来说/dev/cua*是用来拨出的,/dev/ttys*是用来拨入的,但现在好像已经不再区分。 笔者的Modem接在COM1上,所以选择/dev/cua0,按OK按钮确定。 单击控制面板上“Modem Configuration”按钮上方的“Network Configuration”按钮,选择“Interface”标签页,此时由于还没有添加Modem,我们只可以看到lo和eth0两个网络界面,单击Add添加网络界面,在接着出现的“Interface Type”窗口中选择PPP连接方式,并按OK确定。 然后吗?和“瘟酒吧”下的就十分相似了,在Create PPP Interface窗口中的Phone Number中添上你的ISP的电话号码(比如163),在PPP login Name中添上用户名称,在PPP password中添上密码即可。 开始尝试拨号吧!单击“大脚”按钮,选择“AnotherLevel menu”,再选择其中的“Networking”,打开Usernet,可以见到到一个状态栏窗口,ppp0就是Modem的状态,红色代表未接通。 单击“ppp0”开始拨号,状态变成黄色,表示使用中;一阵熟悉的的拨号声后,状态变成了了绿色,表示接通了。 打开你的浏览器开始周游世界吧!只要再单击一下ppp0就可以断开连接了。 上面已经将拨号上网在Gnome下成功地安好了。 对于Linux初学者来说“依葫芦画瓢”便能学会,真是非常的实用。 KDE下拨号KDE下的拨号需要用到kppp这个程序,如果你在安装KDE的时候安装了kdenetwork这个rpm包,你就已经安装好了kppp,kppp的界面比前面的Usernet要漂亮的多,而且功能更加强大,下面我们只介绍一下它的基本使用方式:和Gnome环境下类似,单击左下脚的“大K”→Internet→kppp就打开了kppp拨号程序,此时你面前出现的是一个空空的窗口,单击“Setup”,在“kppp Configuration”窗口中选择“Device”标签页,在其中的“Modem Device”中选择Modem连接的端口“/dev/cua0”,当然你可以在命令行执行“ln /dev/modem /dev/cua0”,然后你就可以在这里选择“/dev/modem”了,在“Connection Speed”中选择你的连接速率。 选择“Accounts”标签页,单击“New”建立新的账号,“Connection Name”中输入连接名,“Phone Number”中输入你的ISP的电话号码,选择“DNS”标签页,在“DNS IP Address”中输入你的ISP的IP地址,单击“Add”添加,OK确定退出。 现在一切都已经设定好了,你又退回到了kppp登录窗口,输入你的账号(Login ID)和密码(Password),然后单击“connect”就开始登录网络了。 需要断线?在连接窗口中,单击“Disconnect”即可。 Linux下的拔号程序比起Windows下的拨号程序也毫不逊色,而且设定还更简单,看谁以后敢说Linux下的拨号程序很难用,而且界面丑陋。 需要说明的是,Linux不支持所谓Winmodem(也就是软猫),这种Modem需要特殊的Windows驱动程序才能使用,目前还没有Linux下的驱动。
发表评论