Linux连接Internet
Linux连接Internet
[root@www ~]# dmesg | grep -in eth377: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 1000e1000 119381 0 <==确实已经加载到内核中 [root@www ~]# modinfo e1000filename: /lib/modules/2.6.32-71.29.1.el6.x86_64/kernel/drivers/net/e1000/e1000.koversion: 7.3.21-k6-NAPIlicense: GPLdescription: 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=eth0HWADDR=08:00:27:71:85:BDONBOOT=yesBOOTPROTO=dhcp <==dhcp自动获取[root@www ~]#service network restart |
[root@www ~]# vim /etc/resolv.conf nameserver 114.114.114.114nameserver 8.8.8.8 |
[root@www ~]# vim /etc/sysconfig/network NETWORKING=yesHOSTNAME=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-pppoerp-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=eth0BOOTPROTO=static IPADDR=192.168.1.1NETMASK=255.255.255.0ONBOOT=yes |
[root@www ~]# pppoe-setupWelcome 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.1Enter 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 workstation2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway for a LANChoose 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: eth0User name: T1234567 Activate-on-demand: No Primary DNS: 168.95.1.1Firewalling: NONEUser Control: noAccept 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=ppp0ONBOOT=no....(其他省略)....[root@www ~]# chkconfig pppoe-server off |
[root@www ~]# lsusbBus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 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 ~]# iwconfiglo no wireless extensions. eth0 no wireless extensions. |
[root@www ~]# iwconfiglo 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 DefaultCountryRegion=5 CountryRegionABand=7CountryCode=CN <==中国的国码代号ChannelGeography=1SSID=yaxin-office <==你的无线路由名称 NetworkType=InfraWirelessMode=9 <==与无线 AP 支持的协议有关Channel=6 <==与 CountryRegion 及侦测到的频道有关....(中间省略)....AuthMode=WPAPSK <==我们的 AP 提供的认证模式 EncrypType=AES <==传送认证码的加密机制WPAPSK="123456780aaa" <==无线密码,最好用双引号括起来较佳....(底下省略).... |
[root@www ~]# modprobe rt3070sta && ifconfig ra0 up [root@www ~]# iwconfig ra0ra0 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=ra0BOOTPROTO=dhcpONBOOT=no <== 若需要每次都自动启动,改成 yes 即可ESSID=yaxin-officeRATE=54M <== 可以严格指定传输的速率,要与上面 iwconfig 相同,单位b/s |
[root@www ~]# ifup ra0Determining IP information for ra0... done. |
Linux连接Internet的更多相关文章
- Linux 连接 Internet
本文根据<鸟哥的Linux私房菜-服务器架设篇>第四章总结 Linux 连接 Internet 前的注意事项 想要连接 Internet 需要配置一组合法的 IP 参数,主要是 IP.Ne ...
- VMware bridge 桥接方式连接internet
经过反复测试,关于VMware内虚拟机(包括ubuntu linux和windows)连接internet 目前的结论是 使用bridge方式时,VMware相当于一个交换机(switch),虚拟机和 ...
- WinServer2008 R2搭建TFS2013小结(无法连接Internet手动安装)
不定时更新参考文档: TFS安装与管理 为本地管理配置本机模式报表服务器 (SSRS) 手里有文档还是掉进各种坑,这里把坑总结一下,方面以后填坑. 安装指导文档中搭建TFS2013用了两台服务器,把S ...
- Linux连接xshell找不到IP信息
虚拟机环境下的Linux连接xshell的网络连接找不到eth0(IP)信息的解决方法 1 输入ifconfig,如果有eth0信息,直接填写eth0上面的IP信息 2 输入ifconfig ...
- linux连接mysql 出现Access denied for user 'root'@'localhost'(using password: YES)错误解决方案
linux连接mysql /usr/local/mysql/bin/mysql -uroot -p 输入密码出现Access denied for user 'root'@'localhost'(us ...
- linux连接sybase数据库-isql
转自:http://blog.knowsky.com/196438.htm 想要linux连接sybase数据库用命令isql: isql [-U login id] [-P password] [- ...
- Ansible 远程服务器连接 Internet 测试
Email 连接: lonnyliu@126.com 需求 在使用Ansible过程中不可避免需要了解远端服务器是否能够联通外网,以便进行在线安装软件或者其他.对于运维人员来说普遍的办法有 1. 登录 ...
- Windows10、ARM开发板、VMware虚拟机同时连接Internet
前段时间有人遇到一些网络连接问题,让我帮忙处理,他想让ARM开发板连接外网,可以连接网络数据库,同时保证自己的电脑可以上网. 本来说直接可以连接一个路由器,分配一个内网IP给ARM就可以了,但是当时那 ...
- linux 连接到阿里云服务器
当Windows拥有xshell软件可以连接到你的远程服务器时,Linux其实自己带有的ssh就可以连接: 具体命令是: ssh root@60.2.5.201.81然后输入你服务器的密码:××××× ...
随机推荐
- ASP.Net中的Web Resource
http://support.microsoft.com/kb/910442,这是中文的,机器翻译的,不太容易看懂,英文的是:http://support.microsoft.com/kb/91044 ...
- Infinite V1 Release Note
游戏地址 PLAY 玩法说明 WASD 控制角色移动 更新内容 - 初步完成了角色移动(攻击状态) 开发心得 独立做游戏 其实最耽误时间的就是在自己的短板上, 对于我来说 就是3D建模和动作制作. ...
- 谈谈LoveLive SIF以及即将诞生的LL练习器
由于课程需要和自身需求以及广大的LLer的需求,这个学期我将做一个造福全世界LLer的安卓app,它的名字是——还没想好(喂),总之是个LL SIF的练习器.什么?你问我LL SIF是什么?看来你不是 ...
- 反编译android的apk
将要反编译的APK后缀名改为.rar或 .zip,并解压 得到其中的classes.dex文件(它就是java文件编译再通过dx工具打包而成的),将获取到的classes.dex放到之前解压出来的 ...
- echarts 图表应用
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 实验三——for语句及分支结构else-if
1.本节课学习到的知识点: (1)for语句是循环语句,它可以实现c语句的重复执行 (2)for语句中的3个表达式的执行顺序和书写顺序不同 (3)遇到复合语句时要用大括号将几句话括起来,复合语句在语法 ...
- Drawable和Bitmap区别
Bitmap - 称作位图,一般位图的文件格式后缀为bmp,当然编码器也有很多如RGB565.RGB888.作为一种逐像素的显示对象执行效率高,但是缺点也很明显存储效率低.我们理解为一种存储对象比较好 ...
- Hdu 2955 Robberies 0/1背包
Robberies Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- JavaScript笔记 Function
在JavaScript中方法由两部分组成: 方法名和方法体. JavaScript中的方法跟其他传统面向对象语言不同,它跟普通的变量没有区别,唯一不同点是它是Function对象,因此它会有一些Fun ...
- Java数据结构之字符串模式匹配算法---KMP算法2
直接接上篇上代码: //KMP算法 public class KMP { // 获取next数组的方法,根据给定的字符串求 public static int[] getNext(String sub ...