今天用win7安装vmware7,同时安装了redhat9.0,通过命令模式配置网卡IP。
====================================================
配置文件通常是/etc/sysconfig/network-scripts/ifcfg-interface-name
====================================================
1.配置网卡IP地址
vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 #物理设备名 IPADDR=192.168.1.102 #IP地址 NETMASK=255.255.255.0 #掩码值 NETWORK=192.168.1.0 #网络地址(可不要) BROADCAST=192.168.1.255 #广播地址(可不要) GATEWAY=192.168.1.1 #网关地址 ONBOOT=yes # [yes|no](引导时是否激活设备) USERCTL=no #[yes|no](非root用户是否可以控制该设备) BOOTPROTO=static #[none|static|bootp|dhcp](引导时不使用协议|静态分配|BOOTP协议|DHCP协议)
-----------------------------------------------------------------------------------
2.配置网卡DNS
配置文件在/etc/resolv.conf下面。
vi /etc/resolv.conf nameserver 192.168.0.1 #主DNS nameserver 192.168.0.10 #次DNS search localdomain
所以网络配置完成后,都需要重启网络服务:service network restart 或/etc/init.d/network restart
3、启动和关闭防火墙
即时生效: 1:#service iptables start #service iptables stop 重启系统生效: 2:#service iptables on #service iptables off