centos6.4静态ip设置于eth1的问题
星期五, 2013-09-06 | Author: Lee | linux | 6,469 views
centos6.4的版本安装好,发现系统内只有eth1,而且/etc/sysconfig/network-scripts/下只有ifcfg-eth0文件,虽然可以上网,但无法设置静态IP.
解决方法:vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100e (e1000)
#SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”08:00:27:f2:31:9b”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”08:00:27:9d:08:ba“, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1”
上面一个eth0直接注释掉,下面一个eth1改为eth0,记录对应的网卡地址 再编辑ifcfg-eth0 如下
DEVICE=eth0 HWADDR=08:00:27:9D:08:BA #UUID=accb31df-ac8b-474c-aad8-b1ecd68ad346 NM_CONTROLLED=yes #BOOTPROTO=dhcp BOOTPROTO=static IPADDR=192.168.0.188 GATEWAY=192.168.0.1 NETMASK=255.255.255.0 ONBOOT=yes TYPE=Ethernet DNS1=192.168.0.1 |
~
网关设置 (上面配置了这里路不用)
在文件vi /etc/sysconfig/network最后一行加入:
GATEWAY=192.168.0.1
/etc/init.d/network restart 重启网络
注:后面要加下DNS1 否则无法上网(oracle VM 安装)
~
文章作者: Lee
本文地址: https://www.pomelolee.com/1241.html
除非注明,Pomelo Lee文章均为原创,转载请以链接形式标明本文地址
一条评论 to centos6.4静态ip设置于eth1的问题
设置 ONBOOT=yes
即可自动获得对应的ip地址,实现上网功能,如果不设置静态IP的话
Leave a comment
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)
2014 年 08 月 12 日