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 使用 ...
随机推荐
- SQL Server:sp_send_dbmail参数设置
sp_send_dbmail [ [ @profile_name = ] 'profile_name' ] [ , [ @recipients = ] 'recipients [ ; n ]' ...
- Log Structured Merge Trees(LSM) 原理
http://www.open-open.com/lib/view/open1424916275249.html
- SpringBoot系列(1)
简介:用来简化新Spring应用的初始搭建以及开发过程:该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置. 特点:1. 创建独立的Spring应用程序2. 嵌入的Tomcat, ...
- RN控件之View Text
/** * 模仿美团首页部分 * */ 'use strict' import React,{ AppRegistry, Component, StyleSheet, Text, View, Imag ...
- ResultSetMetaData和ResultSet
我现在有一张表t_product;我们查询所有的商品:SELECT * FROM t_product; 上述所有的数据都可以封装成一个对象,我们称这个查询出来的对象为结果集对象:ResultSet. ...
- 06_android虚拟机介绍
分辨率不用选太高,否则会占用太大内存.你选高分辨率一跑起来会干掉你的500多MB的内存.1/8内存就没了.百分之97%或者是98%的设备都是ARM CPU.ARM自己不生产CPU,它生产的是一个标准的 ...
- neon eclipse tomcat发布项目乱码
解决方法如图
- storm shell命令源码分析-shell_submission.clj
当我们在shell里执行storm shell命令时会调用shell_submission.clj里的main函数.shell_submission.clj如下: shell_submission.c ...
- Code Page Identifiers - Copy from Microsoft
Code Page Identifiers 78 out of 94 rated this helpful - Rate this topic The following table define ...
- hdu1069
#include <iostream> #include <algorithm> #include <cstring> using namespace std; c ...