CentOS6使用ifconfig命令没有ipv4地址_解决办法,centos6ifconfig
CentOS6使用ifconfig命令没有ipv4地址_解决办法,centos6ifconfig
问题:VMware中CentOS6.0用ifconfig命令查看,发现没有ipv4地址!
解决办法:
步骤1:将网络连接方式从桥接改为NAT连接
步骤2:在终端运行
/etc/init.d/network restart
步骤3:重启系统,运行ifconfig查看。
问题解决。
临时生效命令
#ifconfig eth0 192.168.0.22 netmask 255.255.255.0 (up)
添加第一块网卡ip 与子网掩码
#route add default gw 192.168.0.1 dev eth0
添加缺省路由 gw =gateway 网关 dev eth0设备的第一个网卡
Redhat/Centos
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 设备名称
BOOTPROTO=dhcp /static 自动获取/静态ip
IPADDR=IP地址
NETMASK=掩码
GATEWAY=网关
ONBOOT=yes 开机激活网卡
#service network restart 重启网络
hi.baidu.com/...e4adb1
应该是你跟宿机的网络连接方式不对吧,你直接用桥接试试
评论暂时关闭