Linux连接Internet
[root@www ~] # dmesg | grep -in eth
377:e1000: eth0: e1000_probe: Intel( R ) PRO/1000 Network Connection
383:e1000: eth1: e1000_probe: Intel( R ) PRO/1000 Network Connection
418:e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
419:eth0: no IPv6 routers present
|
[root@www ~] # lsmod | grep 1000
e1000 119381 0 <==确实已经加载到内核中
[root@www ~] # modinfo e1000
filename: /lib/modules/2.6.32-71.29.1.el6.x86_64/kernel/drivers/net/e1000/e1000.ko
version: 7.3.21-k6 -NAPI
license: GPL
description: Intel( R ) PRO/1000 Network Driver
.....(以下省略).....
|
[root@www ~] # vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 <==接口名称
HWADDR=08:00:27:71:85:BD <==网卡MAC地址
ONBOOT=yes <==是否开机启动
BOOTPROTO=static <==取得 IP 的方式,static静态分配
IPADDR=192.168.1.100 <== IP地址
NETMASK=255.255.255.0 <==子网掩码
GATEWAY=192.168.1.254 <==网关
[root@www ~] #service network restart
|
[root@www ~] # vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:71:85:BD
ONBOOT=yes
BOOTPROTO=dhcp <==dhcp自动获取
[root@www ~] #service network restart
|
[root@www ~] # vim /etc/resolv.conf
nameserver 114.114.114.114
nameserver 8.8.8.8
|
[root@www ~] # vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=www.centos.vbird
[root@www ~] # vim /etc/hosts
192.168.1.100 www.centos.vbird
|
[root@www ~] #reboot <==修改完主机名需要重启电脑生效
|
[root@www ~] # rpm -q rp-pppoe <==查看系统有没有安装rp-pppoe
rp -pppoe -3.10-8.el6.x86_64 <==已经安装
|
[root@www ~] # mount /dev/cdrom /mnt
[root@www ~] # cd /mnt/Packages
[root@www ~] # rpm -ivh rp-pppoe* ppp*
|
[root@www ~] # yum -y install rp-pppoe* ppp*
|
[root@www ~] # vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
|
[root@www ~] # pppoe-setup
Welcome to the PPPoE client setup. First, I will run some checks on
your system to make sure the PPPoE client is installed properly...
LOGIN NAME (填写从ISP处取得的账号)
Enter your Login Name (default root): T1234567
# 注意这个账号名称是 ISP 分配的
INTERFACE (ADSL 调制解调器所接的网卡代号)
Enter the Ethernet interface connected to the PPPoE 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
Enter the demand value (default no): no
DNS (填写ISP分配的 DNS)
Enter the DNS information here: 168.95.1.1
Enter the secondary DNS server address here: <==若无第二台就按 enter
PASSWORD (从 ISP 取得的密码)
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): no
FIREWALLING (防火墙方面,先取消,稍后我们根据需求自己定义)
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
Start this connection at boot time (要不要开机立即启动拨号程序?)
Do you want to start this connection at boot time?
Please enter no or yes (default no): yes
** Summary of what you entered **
Ethernet Interface: eth0
User name: T1234567
Activate -on -demand : No
Primary DNS: 168.95.1.1
Firewalling: NONE
User Control: no
Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/sysconfig/network -scripts /ifcfg-ppp0
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf.bak)
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)
|
[root@sky ~] # /etc/init.d/network restart <==启动拨号上网
|
[root@sky ~] # pppoe-stop
[root@sky ~] # pppoe-start
|
[root@www ~] # vim /etc/sysconfig/network-scripts/ifcfg-ppp0
DEVICE=ppp0
ONBOOT=no
....(其他省略)....
[root@www ~] # chkconfig pppoe-server off
|
[root@www ~] # lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 07d1:3c0a D -Link System DWA-140 RangeBooster N Adapter(rev.B2) [Ralink RT2870]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
|
[root@www ~] # iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
|
[root@www ~] # iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
ra0 Ralink STA
|
[root@www ~] # ifconfig ra0 up <==启动无线网卡
[root@www ~] # iwlist ra0 scan
ra0 Scan completed :
Cell 01 - Address: 74:EA:3A:C9:EE:1A
Protocol:802.11b/g/n
ESSID: "yaxin-office"
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=100/100 Signal level=-45 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
....(底下省略)....
|
[root@www ~] # ifconfig ra0 down && rmmod rt3070sta
[root@www ~] # vim /etc/Wireless/RT2870STA/RT2870STA.dat
Default
CountryRegion=5
CountryRegionABand=7
CountryCode=CN <==中国的国码代号
ChannelGeography=1
SSID=yaxin -office <==你的无线路由名称
NetworkType=Infra
WirelessMode=9 <==与无线 AP 支持的协议有关
Channel=6 <==与 CountryRegion 及侦测到的频道有关
....(中间省略)....
AuthMode=WPAPSK <==我们的 AP 提供的认证模式
EncrypType=AES <==传送认证码的加密机制
WPAPSK= "123456780aaa" <==无线密码,最好用双引号括起来较佳
....(底下省略)....
|
[root@www ~] # modprobe rt3070sta && ifconfig ra0 up
[root@www ~] # iwconfig ra0
ra0 Ralink STA ESSID: "vbird_tsai" Nickname: "RT2870STA"
Mode:Auto Frequency=2.437 GHz Access Point:74:EA:3A:C9:EE:1A
Bit Rate=1 Mb/s
RTS thr:off Fragment thr:off
Encryption key:off
Link Quality=100/100 Signal level:-37 dBm Noise level:-37 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
|
[root@www ~] # cd /etc/sysconfig/network-scripts
[root@www network - scripts ] # vim ifcfg-ra0
DEVICE=ra0
BOOTPROTO=dhcp
ONBOOT=no <== 若需要每次都自动启动,改成 yes 即可
ESSID=yaxin -office
RATE=54M <== 可以严格指定传输的速率,要与上面 iwconfig 相同,单位b/s
|
[root@www ~] # ifup ra0
Determining IP information for ra0... done.
|
转载于:https://www.cnblogs.com/hello-sky/p/4533571.html
Linux连接Internet相关推荐
- linux连接磁盘阵列,CentOS/Linux 连接 iSCSI 磁盘阵列
CentOS/Linux连接iSCSI磁盘整列 iSCSI:即Internet Small Computer System Interface 系统环境:CentOS 6.5 mini 磁盘阵列:联想 ...
- win10系统的qq无网络连接网络连接到服务器,Win10系统下误报无法连接internet该怎么办?新手速看...
在日常的工作以及学习当中,电脑已经成为我们身边最亲密的好帮手了,它不但可以帮助我们解决日常的诸多事物,而且还能够让我们足不出户就知晓天下事.当然了,那是必须在电脑连接了internet的前提下.而在电 ...
- 疯狂挂载:Linux连接常用外部设备的方法
Linux是一个优秀的开放源码的操作系统,可以运行在大到巨型小到掌上型各类计算机系统上,随着 linux系统的日渐成熟和稳定以及它开放源代码特有的优越性,linux在全世界得到了越来越广泛的应用.现在 ...
- Linux连接mysql 出现Access denied for user ‘root‘@‘localhost‘(using password: YES)错误解决方案
Linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案 参考文章: (1)Linux连接 ...
- linux系统不能用投影仪,Linux连接投影仪(ubuntu)失败或显示不正常
Linux连接投影仪,网上这方便的资料比较少,尤其是图文资料.最近有这方面的需求,查了很多的资料,最终实现的投影. 直接插上VGA后,发现屏幕显示的不正确,或不显示.这是由于投影仪的分辨率引起的.下面 ...
- linux系统不能用投影仪,Linux连接投影仪(ubuntu)失败或显示不正常--未测试
Linux连接投影仪,网上这方便的资料比较少,尤其是图文资料.最近有这方面的需求,查了很多的资料,最终实现的投影.直接插上VGA后,发现屏幕显示的不正确,或不显示.这是由于投影仪的分辨率引起的. 直接 ...
- 水星mr807虚拟服务器,水星MR807路由器怎么连接Internet上网
一台新购买或者恢复出厂设置后的水星MR807无线路由器,要实现连接Internet上网,需要经过以下配置步骤,本文学习啦小编主要介绍了水星MR807路由器连接Internet上网的方法! 水星MR80 ...
- CISCO PACKET TRACER 实验:以太网连接Internet
实验1:接入网(以太网)连接Internet 重点: ·配置作为接入控制设备的路由器 步骤一:搭好拓扑(拓扑图如下) 步骤二: 配置作为接入控制设备的路由器 步骤三:PC连接接入控制设备,即R1 PC ...
- Linux连接MySQL出现1045错误 解决方法
开始使用Linux连接mysql数据库的时候,出现了1045错误.当出现这个问题的时候,应该是用户被数据库拒绝访问了,我们应该为你的数据库开辟权限. 1.登录数据库输入linux指令 mysql -u ...
- edge浏览器安装无法连接Internet
edge浏览器无法连接Internet那些事儿 - 知乎 (zhihu.com) 原因:.Net Framework 版本太低. 适用于 Windows 的 Microsoft .NET Framew ...
最新文章
- 又来说一下顺序~关于唯一索引和唯一约束的顺序
- python语言有什么用-python语言为什么好呢?它有什么特点?
- 王艳 201771010127《面向对象程序设计(java)》第十七周学习总结
- JavaScript对象及初始面向对象
- django开发个人博客
- jpa命名 多条件查询命名_JPA 2 | 动态查询与命名查询
- perl java_与Perl相比Java性能问题
- 学习开发webpart
- DRUID连接池的使用
- python编程是干嘛的-编程小白必看!Python到底能做什么?
- linux内核的诞生时间,Linux内核诞生已经17年
- java图片像素90翻转_java后台解决上传图片翻转90的问题,有demo,经过测试可用...
- HTTP请求的完全过程
- 内存颗粒位宽和容量_高手进阶,终极内存技术指南(1)
- 开源跨平台2D游戏引擎Love2D介绍
- c语言 switch案例,C语言switch语句实例
- 都说云计算时代是开发的天下,运维都要被下岗淘汰了?可业界大神陈皓却是这样说的!...
- halcon光学字符识别(训练后识别),验证码识别
- 中科院刘康:低资源环境下的事件知识抽取
- 小周资源导航站——导航站