首页 技术 正文
技术 2022年11月10日
0 收藏 573 点赞 3,665 浏览 4149 个字

<一>、centos6.6通过VM最小化安装后上不了网的解决方法:

在安装centos6.6时,没有在网络设置中设置网卡自动启动的,安装完系统后,是不能联网的,解决方法如下:

vi/etc/sysconfig/network-scripts/ifcfg-eth0

把里面的ONBOOT=no  改成yes

/etc/init.d/network restart  重启网络就可以了

百牛信息技术bainiu.ltd整理发布于博客园

<二>、Centos6.6通过VM最小化安装后,找不到网卡,通过配置eth0后也上不了网的解决方法:

在学习centos6.6时,我们通过VM安装Centos6.6系统来学习,在实验中需要用到多台服务器来进行实验,但增加一个服务器都重装一次系统太浪费时间了,我们可以通过VM的克隆方法来添加多台服务器,但问题出现了:为Centos6.6创建VMWare的虚拟机后,复制,创建一个新的克隆镜像,启动和配置网卡无效。

1.配置ifcfg-eth0文件

[root@MrXiong ~]# vim/etc/sysconfig/network-scripts/ifcfg-eth0

把ONBOOT=no 改成yes

保存退出

/etc/init.d/network restart 重启网络报错,

2. [root@ MrXiong ~]# ifconfig     显示不到eth0信息

3.[root@ MrXiong ~]# ifup  eth0   出错device eth0does not seem to be present, delaying initialization

经过度娘和谷哥的帮助,找到原因是:

新克隆的虚拟机镜像的网卡mac地址已经变更。打开虚拟机的.vmx文件,ethernet0.generatedAddress项记录了该虚拟机的mac地址。

解决方法:

编辑如下文件
vim /etc/udev/rules.d/70-persistent-net.rules

一般文件内容是这样的:

# This file was automatically generated by the/lib/udev/write_net_rules
# program, run by thepersistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep eachrule on a single
# line, and change only the value of the NAME=key.# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:20:ea:34",ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:5b:63:e3",ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

注释掉eth0的那个段落,然后将eth1的修改为eth0

修改完后如下:

# This filewas automatically generated by the /lib/udev/write_net_rules
# program, run by thepersistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep eachrule on a single
# line, and change only the value of the NAME=key.# PCI device 0x8086:0x100f (e1000)
#SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:20:ea:34",ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:5b:63:e3",ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

编辑vim /etc/sysconfig/network-scripts/ifcfg-eth0

把HWADDR地正改成上面新的eth0 MAC地址

HWADDR=00:0c:29:5b:63:e3

保存退出

reboot重启服务器后生效

现在用ifconfig 可以查看到eth0相关信息

<三>、新安装centos6.6最少安装后,从163网站下载yum本置文件时出现wget命令不能使用的解决方法:

在centos6.6中,wget是默认安装了,可以直接使用wget来下载,但在6.6最小化安装后,wget是默认没有安装的。

[root@MrXiong yum.repos.d]# wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
-bash: wget: command not found

通过本地yum安装wget

[root@MrXiong yum.repos.d]# yum installwget

安装wget后,我们就可以通过wget下载163的yum

首先备份/etc/yum.repos.d/CentOS-Base.repo

[root@MrXiong/]mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)

[root@MrXiong /]# cd /etc/yum.repos.d/
[root@MrXiong yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@MrXiong yum.repos.d]# mvCentOS6-Base-163.repo CentOS-Base.repo
[root@MrXiong yum.repos.d]yum clean all
[root@MrXiong yum.repos.d]yum makecache

<四>centos6.6安装setup命令

在centos5.8中,我们可以通过setup命令来对firewall,network,system services等进行配置

Centos6.6安装后一些常见问题详解

但在centos6.6最小化安装后,发觉setup命令不管用,从网上度娘和谷哥了一下,发现centos6.6最小化安装,没有把setuptool安装上去,我们可以通过以下方法来解决:

我们可以通过

yum install setuptool –y

yum install system-config-firewall-tui –y

install system-config-network-tui –y

yum install ntsysv –y

安装完上面几个rpm包后,就会出现我们熟悉的setup字符图形界面。

Centos6.6安装后一些常见问题详解

然后我们可以通过以上熟悉的界面来设置IP,route,dns

<五>、centos6.6 与网络时间服务器ntp同步使用ntpdate命令出错

在5.8中,我们使用ntpdate time.nist.gov进行时间效对,但我安装了最小化centos6.6后,发现无论使用/usr/sbin/ntpdate time.nist.gov还是直接ntpdate time.nist.gov都出现错误

[root@MrXiong ~]# cat /etc/redhat-release
CentOS release 6.6 (Final)
[root@MrXiong ~]# ntpdatetime.nist.gov      
-bash: ntpdate: command not found
[root@MrXiong ~]# /usr/sbin/ntpdatetime.nist.gov
-bash: /usr/sbin/ntpdate: No such file ordirectory

解决方法:

通过yum安装ntpdate

[root@MrXiong ~]# yum install ntpdate –y

安装完后,就可以使用ntpdate命令进行时间效对

[root@MrXiong ~]# ntpdate time.nist.gov
 7Nov 02:01:14 ntpdate[4878]: step time server 206.246.122.250 offset-28812.162590 sec

<六>、centos6.6安装mini后通过yum安装man命令 

[root@MrXiong ~]# yum install man -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 *base: mirrors.grandcloud.cn
 *extras: mirrors.grandcloud.cn
 *updates: mirrors.grandcloud.cn
base                                       | 3.7kB     00:00
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,291