centos开机自动启动网络
本来在虚拟机上安装的centos6.0(Final)版本系统,安装的后,由于每次登陆用crt 登,但默认开机不在虚拟机上登陆,crt连不上(网卡没启动)。 接下来 就修改一下 查看一下使用的网卡 。 [hcr@slave2 ~]$ ifconfig eth1 Link encap:Ethernet HWaddr 00:0C:29:8C:BF:DF inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe8c:bfdf/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:220 errors:0 dropped:0 overruns:0 frame:0 TX packets:217 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:21357 (20.8 KiB) TX bytes:26980 (26.3 KiB) Interrupt:19 Base address:0x2000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:4 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:240 (240.0 b) TX bytes:240 (240.0 b) 然后 进入到配置linux网络目录 [hcr@slave2 ~]$ cd /etc/sysconfig/network-scripts修改的网卡配置如下(ONBOOT=yes 开机自启动配置) [hcr@slave2 network-scripts]$ cat ifcfg-eth1 DEVICE="eth1" NM_CONTROLLED="yes" ONBOOT=yes TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth1" IPADDR=192.168.1.13 PREFIX=24 GATEWAY=192.168.1.1 HWADDR=00:0C:29:8C:BF:DF 配置后,接下来再重启用crt连接操作即可,不用每次都先登录虚拟机了