Linux连接Internet
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. |
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然后输入你服务器的密码:××××× ...
随机推荐
- (转载)(收藏)Awk学习详细文档
awk命令 本文索引 [隐藏] awk命令格式和选项 awk模式和操作 模式 操作 awk脚本基本结构 awk的工作原理 awk内置变量(预定义变量) 将外部变量值传递给awk awk运算与判断 算术 ...
- yii框架的安装
在安装YII2.0首先我们需要下载一个composer,何为composer,简单解释为PHP的组件工具, Composer是PHP中用来管理依赖(dependency)关系的工具,你可以在自己的项目 ...
- PAT线性结构_一元多项式求导、按给定步长反转链表、出栈序列存在性判断
02-线性结构1. 一元多项式求导 (25) 设计函数求一元多项式的导数.(注:xn(n为整数)的一阶导数为n*xn-1.) 输入格式:以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过100 ...
- Leetcode: Circular Array Loop
You are given an array of positive and negative integers. If a number n at an index is positive, the ...
- android selector 开始自定义样式
Selector的结构描述: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:a ...
- ArcGis for Android 工作与学习
ArcGis安装 需求 windows7(32/64) Eclipse3.6以上版本 Android Sdk 2.2以上 Jdk 7 安装步骤 Eclipse安装 下载ArcGis插件 在Eclips ...
- Markdown 是什么
tags: Markdown tags && syngx ###Markdown 是什么Markdown 是一种轻量级标记语言,创始人为约翰·格鲁伯(John Gruber).它允许人 ...
- 个人训练记录-赛码"bestcoder"杯中国大学生程序设计冠军赛
A.Movie 题意是给n个线段,要求求出是否存在三个不相交的线段,是的话输出yes,否则输出no.根据贪心的想法,可以先找出右端点r'最小的线段,他是三条线段中最左的那条,再找出左端点l'最大的线段 ...
- Windows Phone 一、XAML基础语法
XAML的命名空间 命名空间格式:语法结构为“xmlns:”+“命名空间前缀名”,默认命名空间无需定义命名空间前缀名“xmlns” 命名空间的声明 <Page x:Class="App ...
- Lunix 命令
awk '{a[$1]+=1;if(a[$1]==1){print $0}}' awk -F ',' '{print $1, $6}' IS.csv | sort -k1n -k2n | awk ...