1.設置固定IP地址linux
eth0網卡信息以下:vim
如今我想把個人本地IP固定成192.168.74.128(若不設置,虛擬機默認的動態IP常常變化好麻煩)bash
1.查看網關地址(個人是192.168.74.2)和子網掩碼地址(個人是255.255.255.0)spa
2.查看DNS,個人是192.168.74.23d
3.配置網卡信息, vim /etc/sysconfig/network-scripts/ifcfg-eth0blog
配置信息以下ip
2. 關閉防火牆:ci
##Linux 6 service iptables stop chkconfig iptables off chkconfig --list | grep iptables ##Linux 7 systemctl stop firewalld systemctl disable firewalld systemctl status firewalld
3. 關閉selinux:get
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config setenforce 0 getenforce