2020/4/18-centos6最小化安装时没有setup解决办法
centos6最小化安装时没有setup,此时虚拟机是没法上网的,因为系统安装时默认网卡是关闭的
ifconfig查看网卡信息,显示没有网卡
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:65536 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:912 (912.0 b) TX bytes:912 (912.0 b)
此时需要修改网卡的配置文件
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:CD:37:26
TYPE=Ethernet
UUID=b9ab056c-44ee-45b4-86d8-e17ff67e27b7
ONBOOT=no
NM_CONTROLLED=yes
BOOTPROTO=dhcp
将ONBOOT=no改为ONBOOT=yes
重启网卡service network restart
ifconfig再查看网卡信息
eth0 Link encap:Ethernet HWaddr 00:0C:29:CD:37:26
inet addr:192.168.31.128 Bcast:192.168.31.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fecd:3726/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20847 errors:0 dropped:0 overruns:0 frame:0
TX packets:10311 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:28470530 (27.1 MiB) TX bytes:1069095 (1.0 MiB)
xshell连接root用户
yum -y install setuptool
安装setup命令工具
yum -y install ntsysv
安装setup工具配套的系统服务组件
yum -y install system-config-securitylevel-tui
安装setup工具配套的防火墙配置组件
yum -y install system-config-network-tui
安装setup工具配套的网络配置组件
yum -y install authconfig-gtk
安装setup工具配套的验证配置组件
yum -y install system-config-keyboard
安装setup工具配套的键盘配置组件
输入setup就可以进行网络配置了