Linux配置防火墙添加端口(Ubuntu/Debian无法使用此方法)
注意:Ubuntu/Debian无法使用此方法
1、打开iptables
vi /etc/sysconfig/iptables
2、添加防火墙规则
规则参考:http://www.cnblogs.com/EasonJim/p/6847874.html
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT
3、防火墙生效
service iptables restart
Linux配置防火墙添加端口(Ubuntu/Debian无法使用此方法)的更多相关文章
- Linux配置防火墙8080端口
1.查看防火墙状态,哪些端口开放了 /etc/init.d/iptables status 2.配置防火墙 vi /etc/sysconfig/iptables ################### ...
- Linux配置防火墙,开启80端口、3306端口
Linux配置防火墙,开启80端口.3306端口 起因是因为想使用Navicat连接一下数据库,发现连接不上 通过查阅许多资料和多次测试发现是因为防火墙没有配置3306端口 话不多说,开整,同理, ...
- Windows Server 2008企业64位版防火墙添加端口的方法
原始地址:http://www.veryhuo.com/a/view/48280.html 什么是防火墙的入站规则和出站规则 简单的说 出站就是你访问外网 入站就是外网访问你 记得在两年前写过一篇教程 ...
- linux 中将用户添加到组的 4 个方法
Linux 组是用于管理 Linux 中用户帐户的组织单位.对于 Linux 系统中的每一个用户和组,它都有惟一的数字标识号.它被称为 用户 ID(UID)和组 ID(GID).组的主要目的是为组的成 ...
- linux配置防火墙 Centos7下 添加 端口白名单
最近在阿里云服务器centos7上部署项目 要开启8484端口 , CentOS 7默认使用的是firewall作为防火墙 在firewall下开启端口白名单 1.查看下防火墙的状态:systemct ...
- Linux Centos7配置防火墙开启端口
在使用centos7安装完mysql.tomcat.nginx后,都需要配置防火墙才能正常访问. 下面系统的学习一下防火墙的配置. centos7默认使用firewall,需要关闭,然后使用iptab ...
- Linux配置防火墙端口 8080端口
1.查看防火墙状态,哪些端口开放了 /etc/init.d/iptables status 2.配置防火墙 vi /etc/sysconfig/iptables ################# ...
- linux配置防火墙,开启端口
Centos7,配置防火墙,开启端口 1.查看已开放的端口(默认不开放任何端口) firewall-cmd --list-ports 2.开启80端口 firewall-cmd --zone=publ ...
- linux防火墙添加端口
防火墙配置文件: /etc/sysconfig/iptables 1.使用命令查看端口开启情况(下图为安装时未选择开启防火墙) [root@fullstack ~]# iptables -L -n ...
随机推荐
- RN原生的安卓UI组件
https://facebook.github.io/react-native/docs/native-components-android.html 这里有一大堆的原生组件可以用,一些是平台自带的, ...
- java 获取计算机内存
文章来源:https://www.cnblogs.com/hello-tl/p/9341900.html package com.boot.demo.springbootdemo.common.uti ...
- pycharm添加wordcloud模块时报错:error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
windows 7 32bit python3.6.3 32bit pycharm2018社区版 32bit 问题说明: 添加wordcloud模块时报错:error: Microsoft Visua ...
- python基础学习笔记——迭代器
我们之前一直在用可迭代对象进行操作,那么到底什么是可迭代对象.我们现在就来讨论讨论可迭代对象.首先我们先回顾下我们 熟知的可迭代对象有哪些: str list tuple dic set ...
- js--如何判别 null undefined
收集资料如下判断: 1.判断undefined: ? 1 2 3 4 var tmp = undefined; if (typeof(tmp) == "undefined"){ a ...
- BNUOJ 6727 Bone Collector
Bone Collector Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Origin ...
- [uiautomator篇]uiwatcher 的使用场景
http://www.yangyanxing.com/article/use-watcher-in-uiautomator.html 今天在uiautomator中实践了watcher的用法,这个 ...
- Ubuntu16.04 on ThinkPad E455 不能识别耳机 的解决方法
去年 (2016) 2月份在ThinkPad E455 上安装了Ubuntu 14.04 LTS (dual boot with Windows 10, upgraded to Ubuntu 16.0 ...
- BZOJ 2154 Crash的数字表格 ——莫比乌斯反演
求$\sum_{i=1}^n\sum_{j=1}^n lcm(i,j)$ 枚举因数 $ans=\sum_{d<=n} F(d) * d$ $F(d)$表示给定范围内两两$\sum_{gcd(i, ...
- 算法总结——主席树(poj2104)
题目: Description You are working for Macrohard company in data structures department. After failing y ...