How can i use iptables on centos 7?
2015-10-29 13:50
363 查看
I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpdservice, but something wrong with my iptables service ... what's wrong with it? What am I doing wrong?
With RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. IMHO, firewalld is more suited for workstations than for server environments.
It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service:
Then, install the iptables-services package:
Enable the service at boot-time: IT网,http://www.it.net.cn
Managing the service
Systemctl doesn't seem to manage the save action like you were able to do in the past with service:
This fixed it: Linux学习,http:// linux.it.net.cn
# ifconfig/sbin/service iptables save bash: ifconfig/sbin/service: No such file or directory # /sbin/service iptables save The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl. # sudo service iptables status Redirecting to /bin/systemctl status iptables.service iptables.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead) # /sbin/service iptables save The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl. # sudo service iptables start Redirecting to /bin/systemctl start iptables.service Failed to issue method call: Unit iptables.service failed to load: No such file or directory.
With RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. IMHO, firewalld is more suited for workstations than for server environments.
It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service:
systemctl stop firewalld systemctl mask firewalld[/code]
Then, install the iptables-services package:
yum install iptables-services[/code]
Enable the service at boot-time: IT网,http://www.it.net.cn
systemctl enable iptables[/code]
Managing the service
systemctl [stop|start|restart] iptables[/code]
Systemctl doesn't seem to manage the save action like you were able to do in the past with service:
/usr/libexec/iptables/iptables.init save[/code]
This fixed it: Linux学习,http:// linux.it.net.cn
yum install iptables-servicessystemctl mask firewalld
systemctl enable iptablessystemctl enable ip6tables
systemctl stop firewalld
systemctl start iptables
systemctl start ip6tables
相关文章推荐
- Linux中使用diff生成的补丁格式说明
- linux下vi编辑器命令大全
- Linux 技巧:让进程在后台可靠运行的几种方法
- linux下查找某个文件位置的方法
- CentOS系统恢复误删除的文件
- Linux有问必答:如何强制在下次登录Linux时更换密码
- linux大概的启动顺序
- Linux操作系统中,*.zip、*.tar、*.tar.gz、*.tar.bz2、*.tar.xz、*.jar、*.7z等格式的压缩与解压
- Centos 部署安装keepalived(1)
- 我的linux服务器(二)
- linux基础重温
- 每天一个linux命令(25):linux文件属性详解
- 【惊爆】马哥linux2016最新实战班课程重磅上线
- linux笔记
- jfinal 在linux下报applicationContext.xml找不到
- 为AM335x移植Linux内核主线代码了解dts
- 在windows操作系统下安装linux
- Linux系统下findmnt命令使用全解
- 扩展虚拟机linux存储空间
- Linux查询主机工作状态