centos 7.0 常见配置

(1)、 centos 7.0 查看系统版本号
# cat /etc/redhat-release
# uname -a
# uname -r

(2)、centos 7.0  ip配置
查看ip的命令 # ip addr
# cd /etc/sysconfig/network-scripts/
# ls
ifcfg-enp3s0

(3)、centos 7.0 查看网卡状态和重启网卡
# service network status
# /etc/init.d/network restart

(4)、 centos7 防火墙操作
CentOS 7.0默认使用的是firewall作为防火墙,如果改为iptables防火墙,需要关闭和禁用firewall防火墙
# systemctl stop firewalld.service
# systemctl disable firewalld.service
# systemctl mask firewalld.service
安装iptables防火墙
# yum -y install iptables-services
启动设置防火墙
# systemctl start iptables.service
设置防火墙开机启动
# systemctl enable iptables.service
重启防火墙服务
# systemctl restart iptables.service
查看防火墙状态
# systemctl status iptables.service
防火墙配置文件路径
/etc/sysconfig/iptables

(5)、CENTOS 7开启路由转发功能
# vi /etc/sysctl.conf
net.ipv4.ip_forward=1
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
# sysctl -p

相关新闻

联系我们

全国服务热线

400-033-9553

电子邮件:admin@example.com
工作时间:09:00-17:00 周一至周五

在线客服
关注微信
关注微信
分享本页
返回顶部