1. 程式人生 > >centos7下關閉防火墻、selinux、掛載光盤和設置ip

centos7下關閉防火墻、selinux、掛載光盤和設置ip

mct 防火墻 roo 開機自動掛載 設置 df -h 修改ip oot iso

使用命令修改ip地址的方法:
[root@localhost~]#vi /etc/sysconfig/network-scripts/ifcfg-ens33
按i可以添加修改內容
ONBOOT="no"改成yes 開啟網卡
BOOTPROTO="dhcp" 改成none或static
IPADDR=192.168.159.129
NETEWAY=255.255.255.0
GATEWAY=192.168. 159.1
DNS1=8.8.8.8
重啟網卡服務
[root@localhost ~]# systemctl restart network

關閉防火墻並設置開機不啟動
查看防火墻開啟情況

systemctl status firewalld
active 開啟 (running)
Active: inactive (dead) 關閉
臨時關閉: systemctl stop firewalld
開機關閉防火墻:
[root@localhost ~]# systemctl disable firewalld
重啟計算機生效

臨時和關閉Selinux
查看selinux開啟情況
[root@localhost ~]# getenforce
Enforcing 開啟 Permissive 關閉
臨時關閉selinux
[root@localhost ~]# setenforce 0
徹底關閉selinux

[root@localhost ~]# vi /etc/sysconfig/selinux
SELINUX=disabled
最後重啟服務生效
[root@localhost ~]# systemctl restart network
設置系統光盤開機自動掛載
[root@localhost ~]#
echo "/dev/sr0 /mnt iso9660 defaults 0 0 " >> /etc/fstab
將全部文件的內容全掛載一下
查看掛載情況
[root@localhost ~]# df -h

centos7下關閉防火墻、selinux、掛載光盤和設置ip