Linux安装防火墙

来源:互联网 发布:淘宝dota2代练 编辑:程序博客网 时间:2024/06/04 01:39

1、安装防火墙
  1)yum install iptables(centos) 安装IPtables服务 yum install iptables-services
  2)清楚规则iptables -F iptables -X iptables -Z
  3)端口放行#
    (1)允许访问22端口 

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

    (2)允许访问80端口

 iptables -A INPUT -p tcp --dport 80 -j ACCEPT

    (3)允许访问8080端口 

iptables -A INPUT -p tcp --dport 8080 -j ACCEPT

  4)消息出站放行 iptables -P OUTPUT ACCEPT
  5)屏蔽端口 iptables -A INPUT -p tcp –dport 8080 -j DROP \\ iptables -A OUTPUT -p tcp –sport 80 -j DROP
  6)屏蔽ip iptables -I INPUT -s IP地址 -j DROP
  7)开启iptables防火墙 systemctl start iptables.service
  8)重启防火墙 service iptables restart
  9)安装相关操作网址:http://www.cnblogs.com/kreo/p/4368811.html

2、映射端口

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 八门神器下载安装 八门金锁阵 八门遁甲第四门 八门神器破解版下载 八门遁甲顺序 八门神器怎么用 凯开八门打斑那集 八门神器破解版 八门神器gamekiller 八门神器ios 八门助手 外八门 生死八门口诀 八门神 八门凯 八门修改器 门神 洪门老八 八门神器已付费破解版 八门神器怎么使用 八门神器2.6 8门神器下载 八门神器4.1破解版 八门神器2.6破解版 八门神器ios版 八门神器修改器 八门神器下载安卓版 下载八门神器 八门遁甲是哪八门 八门神器吧 八门神器软件 8门神器 八门神器老版本 八门神奇 安卓八门神器 八门神器源 仙之侠道八门刀法 八门神气 八门衣柜 八门修改 九宫八门