Articles of iptables

不能允许转发端口443到8443而不允许8443在ufw上

我通过iptables和ufwconfiguration了端口转发。 但有一些我不明白,我只是不能让iptables转发端口443到8443, 而不允许在UFW 端口8443 。 我希望端口443转发到端口8443,但我也希望端口8443被禁止从我的networking外部。 在简历中,如果我完全允许UFW上的端口443和8443,我只能将端口443转发到8443。 这是我在以后的唯一规则: -A PREROUTING -i eth0 -p tcp –dport 443 -j REDIRECT –to-port 8443 这是我的iptables路由configuration(非常简单): pkts bytes target prot opt in out source destination 0 0 REDIRECT tcp — eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 redir ports 8443 这是我的UFW状态: To Action From — —— —- 22 ALLOW Anywhere 443 […]

不能防火墙脚本运行时连接到本地主机的MySQL

我有以下问题: 当我的防火墙规则处于活动状态时,我无法运行etherpad。 我的防火墙: http : //pastebin.com/82APzKhi telnet localhost 3306给出连接超时 ps aux | grep mysql: root 15212 0.0 0.0 4112 712 ? S 13:54 0:00 /bin/sh /usr/bin/mysqld_safe mysql 15526 0.7 0.9 426056 75392 ? Sl 13:54 0:27 /usr/sbin/mysqld –basedir=/usr –datadir=/var/lib/mysql –plugin-dir=/usr/lib/mysql/plugin –user=mysql –pid-file=/var/run/mysqld/mysqld.pid –socket=/var/run/mysqld/mysqld.sock –port=3306 root 15527 0.0 0.0 5512 720 ? S 13:54 0:00 logger […]

IP6tables阻止INPUT? 无法连接到YouTube API

我以为有一个简单的ipv6防火墙,但事实certificate是地狱。 不知何故,我真的不能连接任何ipv6从我的机器,除非我设置INPUT政策接受。 在我目前的ip6tables下面 ip6tables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT all anywhere anywhere state RELATED,ESTABLISHED ACCEPT ipv6-icmp anywhere anywhere ACCEPT tcp anywhere anywhere tcp dpt:http ACCEPT tcp anywhere anywhere tcp dpt:https Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination 如果我尝试连接任何ipv6 […]

使用iptables进行非路由器机器的带宽监视

我在这里遇到了这个教程,介绍了如何使用iptables监视带宽。 我想适应一个非路由器的机器,所以我想知道有多less数据正在进出,而不是通过。 这里是我添加的规则: iptables -N ETH0_IN iptables -N ETH0_OUT iptables -I INPUT -i eth0 -j ETH0_IN iptables -I OUTPUT -o eth0 -j ETH0_OUT 这里是一个输出示例: user@host:/tmp$ sudo iptables -x -vL -n Chain INPUT (policy ACCEPT 1549 packets, 225723 bytes) pkts bytes target prot opt in out source destination 199 54168 ETH0_IN all — eth0 * 0.0.0.0/0 […]

iptables将单个网站stream量redirect到端口8080

我的目标是能够通过代理与一个,并且只有一个网站build立连接。 其他一切都应该放弃。 我已经能够成功地做到这一点,没有这个代码的代理: ./iptables -I INPUT 1 -i lo -j ACCEPT ./iptabels -A OUTPUT -p udp –dport 53 -j ACCEPT ./iptables -A OUTPUT -p tcp -d www.website.com –dport 80 -j ACCEPT ./iptables -A INPUT -m conntrack –cstate ESTABLISHED,RELATED -j ACCEPT ./iptables -P INPUT DROP ./iptables -P OUTPUT DROP 除了将stream量redirect到8080端口,我怎么能做同样的事情呢? 我一直试图在PRATOUTING链在nat表中redirect。 我不确定这是否适合这样做的地方。 谢谢你的帮助!

centos iptables,将tcp端口限制到特定的ips

我想在我的CentOS 5.8服务器上修改iptables,以便只有特定的ips可以连接到特定端口上的机器。 目前,我在我的iptables文件中有以下内容: -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5000 -j ACCEPT 如果我只想允许访问ips 1.1.1.1和1.1.1.2,我将如何修改该行? (当我这样做时,它们可能不一定是顺序的)。

如何在iptables中允许一个域名

我正在寻找一种方法,使iptables只接受我的域名的请求,并拒绝其他人。 最近我错误地configuration了我的apache代理,现在它已经被修复了,但是我一直在收到一些看起来像这样的请求: xxxx.xx:80 142.54.184.226 – – [12/Sep/2012:15:25:14 +0200] "GET http://ad.bharatstudent.com/st?ad_type=iframe&ad_size=700×300&section=3011105&pub_url=${PUB_URL} HTTP/1.0" 200 4985 "http://www.gethealthbank.com/category/medicine/" "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)" xxxx.xx:80 199.116.113.149 – – [12/Sep/2012:15:25:14 +0200] "GET http://mobile1.login.vip.ird.yahoo.com/config/pwtoken_get?login=heaven_12_&src=ntverifyint&passwd=7698ca276acaf6070487899ad2ee2cb9&challenge=wTBYIo2AEdMFr6LtdyQZPqYw9FS9&md5=1 HTTP/1.0" 200 425 "-" "MobileRunner-J2ME" 我想阻止。 我怎样才能pipe理这个?

iptables每12秒会丢弃80个端口

我有一个奇怪的问题。 问题是,系统日志包含(每12秒)一个logging/阻止连接,例如这一个logging到谷歌: iptables denied: IN=eth0 OUT= SRC=66.249.66.52 DST=<MY_SERVER_IP> LEN=60 TOS=0x00 PREC=0x40 TTL=55 ID=49488 DF PROTO=TCP SPT=47902 DPT=80 WINDOW=14600 RES=0x00 SYN URGP=0 或者这个到Opera Mini: iptables denied: IN=eth0 OUT= SRC=141.0.8.219 DST=<MY_SERVER_IP> LEN=60 TOS=0x00 PREC=0x40 TTL=58 ID=41251 DF PROTO=TCP SPT=50426 DPT=80 WINDOW=14600 RES=0x00 SYN URGP=0 iptables规则(删除ssh规则): # Generated by iptables-save v1.4.12 on Sat Sep 29 14:25:22 2012 *filter […]

何时使用–socket与iptables存在?

我正在学习iptables,而且我很难理解何时使用“所有者”匹配器的“–socket-exists”选项。 你能解释一下这个选项的实际好处吗(如果可能,举个例子)?

如何打开http服务器的Linux

我是一名Windows(IIS)软件工程师,但是最近我被抛入Linux服务器pipe理员angular色,直到find能够填补这个位置的人。 我不以为耻,承认我不知道我在做什么。 目前我试图解决的问题是服务器只响应https请求。 但是, 我们也需要它来响应标准的http请求。 我们没有什么需要保持安全的方式去请求者。 我使用bash shell运行redhat linux。 如果有人可以告诉我如何启用http请求,我真的很感激它! 请确保你的回应是一步一步的,因为我有最小的命令行体验:/