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然后输入你服务器的密码:××××× ...
随机推荐
- 【搬运】systemctl 命令完全指南
Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器. Systemd是一个系统管理守护进程.工具和库的集合,用于取代System V初始进程.Systemd的功能是 ...
- TIJ——Chapter Eleven:Holding Your Objects
Java Provides a number of ways to hold objects: An array associates numerical indexes to objects. It ...
- struts-OGNL
特点 常用来访问值栈里对象属性的一种语言 通常由struts标签来解析执行 <%@ taglib prefix="s" uri="/struts-tags" ...
- web前端基础知识 - Django进阶
1. 路由系统 1.1 单一路由对应 url(r'^index$', views.index), 1.2 基于正则的路由 url(r'^index/(\d*)', views.index), url( ...
- jquery cdn/////////////////zzz
jquery-2.1.1 注:jquery-2.0以上版本不再支持IE 6/7/8)百度引用地址 (推荐目前最稳定的,不会出现延时打不开情况) 百度压缩版引用地址:<script src=&qu ...
- springmvc中的controller是单例的
今天发现spring3中的controller默认是单例的,若是某个controller中有一个私有的变量a,所有请求到同一个controller时,使用的a变量是共用的,即若是某个请求中修改了这个变 ...
- 2.6 C#的数据转换
C#有多种数据类型,每种数据类型只能存储这种类型的变量,但又的时候我们需要各种类型之间的转换.比如在计算2+3.5的时候,这个时候有两种情况: 自动类型转换:2种不同类型的数据运算,低精度类型的数值会 ...
- Windows Phone 六、JSON序列化
JSON序列化 public class Person { public int Id { get; set; } public string Name { get; set; } public in ...
- linux更改 DNS 的一般方式
一.第一种方法(常规方法) 在 Linux (笔者用fedora) 下当使用 NetworkManager时,更改 DNS 的一般方式: 修改 /etc/resolv.conf 文件, 添加 &quo ...
- Win下,通过Jstack截取Java进程中的堆栈信息
在Java软件的使用过程中,有时会莫名的出现奇怪的问题.而这些问题常常无法使用日志信息定位,这时我们就需要通过查看进程内部线程的堆栈调用关系来分析问题出在哪里. 举个例子,当我们在做某个操作时,莫名的 ...