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然后输入你服务器的密码:××××× ...
随机推荐
- centos 安装pptp
1. 安装依赖 ppp yum -y install ppp 2. 编译安装pptpd wget http://jaist.dl.sourceforge.net/project/poptop/pptp ...
- goim 及时消息 集成
https://github.com/roamdy/goim-oc-sdk goim 及时消息 集成
- SCRUM 流程的步骤2: Spring 计划
1. product backlog. 2. 把故事进一步拆分成任务. 5. 形成Sprint backlog. Scrum master隆重登场,组织大家按照SCRUM流程,步步为营顺利开展工作 ...
- 不同数据库中同一张表的SQL循环修改语句
select sample_value,Sample_GUID,row_number() over(order by sample_value )as rownumber into #AATemp ...
- Fiddler的一些坑: !SecureClientPipeDirect failed: System.IO.IOException
手机的请求Fiddler可以捕捉,但是手机一直无法上网,在logs中看到的日志如下: !SecureClientPipeDirect failed: System.IO.IOException 由于远 ...
- 3-PHP全部编码UTF-8
0-html <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ...
- Android 资源(resource详解(转)
本文介绍在Android开发中关于资源文件的存储操作.对于Android资源也是非常重要的,主要包括文本字符串(strings).颜色(colors).数组(arrays).动画(anim).布局(l ...
- ExtJS6 TreePanel树节点合上展开显示不同图标
TreePanel的节点如包含子节点,可在展开/合上时显示不同的图标,增强客户端效果,提高用户体验.非常简单,使用TreePanel的两个事件:beforeitemexpand和beforeitemc ...
- xib加载的两种方式
•Xib文件的加载 Ø方法1 NSArray *objs = [[NSBundle mainBundle] loadNibNamed:@"AppView" owner:nil ...
- HttpClient——Get,Post
package com.ch.day5_httpclient; import java.util.List; import com.ch.myutils.NetWorkUtil; import com ...