CentOS 7 iptables 开放8080端口
# 安装iptables-services
[root@localhost bin]# yum install iptables-services
[root@localhost bin]# /bin/systemctl status iptables.service
# 临时开放端口
[root@localhost sysconfig]# iptables -I INPUT -p tcp --dport -j ACCEPT
# 重启iptables临时端口失效
[root@localhost sysconfig]# /bin/systemctl restart iptables iptables.service
[root@localhost sysconfig]# vi /etc/sysconfig/iptables
======================================================================================
# Generated by iptables-save v1.4.21 on Fri May ::
*filter
:INPUT ACCEPT [:]
:FORWARD ACCEPT [:]
:OUTPUT ACCEPT [:]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Fri May ::
# Generated by iptables-save v1.4.21 on Fri May ::
*nat
:PREROUTING ACCEPT [:]
:INPUT ACCEPT [:]
:OUTPUT ACCEPT [:]
:POSTROUTING ACCEPT [:]
COMMIT
# Completed on Fri May ::
======================================================================================
# -A INPUT -p tcp -m state --state NEW -m tcp --dport -j ACCEPT
# 8080端口永久生效
[root@localhost sysconfig]# /bin/systemctl restart iptables iptables.service
[root@localhost sysconfig]# lsof -i:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java sony 48u IPv6 0t0 TCP *:webcache (LISTEN) # telnet 192.168.1.106
CentOS 7 iptables 开放8080端口的更多相关文章
- SUSE Enterprise Server 12 SP3 64 设置防火墙开放8080端口
SUSE Enterprise Server 12 SP3 64 设置防火墙开放8080端口 第一种方式: 1.sudo chmod a+w /etc/sysconfig/SuSEfirewall2 ...
- SUSE Enterprise Server 12 SP3 64 设置防火墙开放8080端口,出现Unsafe permissions for file /etc/sysconfig/SuSEfirewall2 to be sourced
SUSE Enterprise Server 12 SP3 64 设置防火墙开放8080端口时出现 Unsafe permissions for file /etc/sysconfig/SuSEf ...
- Centos 7 iptables 开放端口
MySQL 开放远程连接时, 已经打开了对应端口的安全组发现还是连接不上, 那么就需要 check 一下防火墙端口是否开放. firewall-cmd --zone=public --query-po ...
- linux iptables开放/关闭端口命令
在CentOS/RHEL 7以前版本上开启端口 #开放端口:8080/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT#将更改进行保存/etc/ ...
- Centos配置iptables开放ftp服务
安装完vsftpd后,默认情况下,CentOS的防火墙是不开放ftp服务的,需要添加模块和开放21端口才能提供ftp访问.1.添加ip_conntrack_ftp 模块[root@hexuweb101 ...
- linux下tomcat无法远程访问(开放8080端口)
我们在linux下配置了tomcat后发现,无法访问除了linux(如果是虚拟机的话,宿主机子根本无法访问tomcat),解决下吧 原因是我们的tomcat访问需要8080端口,但是从外部访问,我们的 ...
- CentOS7 防火墙firewalld 和 CentOS6 防火墙iptables 开放zabbix-agent端口的方法
我们在生产环境中,一般都是把防火墙打开的,不像测试环境,可以直接关闭掉.最近安装zabbix ,由于公司服务器既有centos 7又有centos 6,遇到了一些防火墙的问题,现在正好把centos防 ...
- Linux 防火墙iptables开放特定端口
1.查看状态:iptables -L -n2.直接编辑:vi /etc/sysconfig/iptables3.端口开放:-A INPUT -m state --state NEW -m tcp -p ...
- Linux中使用iptables开放特定端口
禁止其他主机对该特定主机进行访问和远程连接控制,所以只开放特定端口 只控制INPUT链就可达到控制其他主机对该主机的访问. 1.首先关闭INPUT链 iptables -P INPUT DROP 使用 ...
随机推荐
- 机器学习:Jupyter Notebook中Matplotlib的使用
一.matplotlib绘制折线图 matplotlib绘图的实质是折线图,将所有的点用直线连接起来,由于距离比较密,看起来像是个平滑的曲线: import matplotlib as mpl:加载m ...
- TModJS:template
ylbtech-TModJS: 1.返回顶部 2.返回顶部 3.返回顶部 4.返回顶部 5.返回顶部 6.返回顶部 作者:ylbtech出处:http://ylbtech. ...
- Lua常用API
转自:http://www.cnblogs.com/ringofthec/archive/2010/10/22/lua.html 1. 建一个新表 void lua_createtable (lua ...
- CI框架 Fatal error: Call to undefined method CI_DB::CI_DB() in D:\xinqing\web\CodeIgniter\database\drivers\odbc\odbc_driver.php on line 53
Fatal error: Call to undefined method CI_DB::CI_DB() in D:\xinqing\web\CodeIgniter\database\drivers\ ...
- IIS备份和还原
当我们电脑系统有大量的站点和虚拟目录的时候,电脑因为种种原因需要重做系统,那么重装系统后这些站点我们是否只能一个一个的添加,如果有成百上千个站点呢,任务量可想而知,本文将介绍如何备份和还原window ...
- window下git,TortoiseGit安装,以及和github托管项目
下载地址:http://msysgit.github.io/,安装时最好是先装git,再安装TortoiseGit. 一.git安装 1.第一步 2.第二步 3.第三步 4.第四步 5.第五步 6.第 ...
- Java 决策制定
有两种类型的决策在Java中的语句,它们分别是: if 语句 switch 语句 if 语句: if语句由一个布尔表达式后跟一个或多个语句. 语法: if语句的语法是: if(Boolean_expr ...
- HTTP返回码中301与302的区别
一.官方说法 301,302 都是HTTP状态的编码,都代表着某个URL发生了转移,不同之处在于: 301 redirect: 301 代表永久性转移(Permanently Moved). 302 ...
- .clearfix:after
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- PopupWindow-----listview item的点击出现PopupWindow
/** * 设置listview item的点击事件 */ lv_app_manager.setOnItemClickListener(new OnItemClickListener() { @Ove ...