盈通四海 发表于 2023-12-21 16:14:55

vmware虚拟机 linux 本地yum源,网卡配置ens33,防火墙selinux



1、挂载镜像文件,CentOS-7-x86_64-DVD-1804.iso,并且要处于连接状态
#光盘挂载至/mnt
mount /dev/sr0 /mnt
#备份yum源文件
cd /etc/yum.repos.d/
mkdir -p ./bak
mv CentOS* ./bak
#编缉本地源
vim local.repo

name=CentOS7
baseurl=file:///mnt
enable=1
gpgcheck=0
 
关闭防火墙并设置开机不启动
firewall 服务开启与关闭
firewalld状态:# systemctl status firewalld.service
关闭 firewalld:# systemctl stop firewalld
开启firewalld:# systemctl start firewalld
开机自动关闭firewalld:# systemctl disable firewalld
开机自动启动firewalld:# systemctl enable firewalld
查看开机是否启动服务:# chkconfig --list|grepnetwork##centos 6
临时关闭和永久关闭selinux
临时关闭selinux
# getenforce
Enforcing
# setenforce 0
setenforce: SELinux is disabled
永久关闭selinux
# vim /etc/selinux/config
改:SELINUX=enforcing   
为:SELINUX=disabled
# reboot   //重启系统生效
 
 
3、固定虚拟机的网卡
在linux操作系统终端执行如下命令:
#进入网卡所在目录
#cd/etc/sysconfig/network-scripts/
#安装vim编缉器
#yuminstallvim-y(需要虚拟机可以上外网)
#编缉网卡,固定ip地址
#vimifcfg-ens33(修改网卡内容如下)
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
NAME="ens33"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=192.168.100.200
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
DNS1=114.114.114.114
#使用systemctl管理工具重启网卡
#systemctl restart network
执行ipa,查看linuxip地址
 
 在xshell软件里输入 reconnect是再连接


来源:https://www.cnblogs.com/dyysh/p/17918574.html
免责声明:由于采集信息均来自互联网,如果侵犯了您的权益,请联系我们【E-Mail:cb@itdo.tech】 我们会及时删除侵权内容,谢谢合作!
页: [1]
查看完整版本: vmware虚拟机 linux 本地yum源,网卡配置ens33,防火墙selinux