修改基本配置
1.修改主机名
vi /etc/sysconfig/network
vi /etc/hostname
保存重启系统即可 reboot 命令可以快速重启虚拟机
2.IP地址修改
vi /etc/sysconfig/network-scripts/ifcfg-ens33
3.修改IP和主机名的映射
如果我们要设置IP和主机名的映射,只需要修改 /etc/hosts 即可
vi /etc/hosts
4.查看IP
centos6.5
ifconfig
centos7.0
ip addr
5.防火墙
查看防火墙状态
firewall-cmd --state
停止防火墙
systemctl stop firewalld.service
stop命令只能暂时停止,系统重启后防火墙又会打开
选择禁止防火墙开机启动,然后reboot重启虚拟机
systemctl disable firewalld.service
在centos6.5版本下的防火墙操作命令
临时关闭
service iptables stop
service iptables start
永久关闭
chkconfig iptables on
chkconfig iptables off
查看防火墙状态
service iptables status
重启:reboot