iptables + iptables_netflow:iptables阻止netflow导出?

我正在OpenSuSE 11.3上运行一个iptables防火墙 – 最近我对stream量监控和记帐产生了兴趣,并为此在防火墙上安装了iptables_netflow模块,并在另一台服务器上安装了Wanguard平台。 iptables_netflow模块是build立和安装和聚合数据; 我可以在/ proc / slabinfo和/ proc / net / stat / ipt_netflow中看到统计信息的变化。 Wanguardconfiguration和工作,因为我有了一段时间将networkingstream量数据导入到它,以确保它的工作。 但是,我无法从防火墙获得netflow输出到WANGuard服务器。 我的iptablesconfiguration可以阻止它吗? iptables_netflow在UDP端口2055上导出。iptables -L的输出-n(在防火墙上)

Chain INPUT (policy ACCEPT) target prot opt source destination NETFLOW all -- 0.0.0.0/0 0.0.0.0/0 NETFLOW FW-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT) target prot opt source destination NETFLOW all -- 0.0.0.0/0 0.0.0.0/0 NETFLOW ACCEPT all -- 192.168.3.0/24 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) target prot opt source destination NETFLOW all -- 0.0.0.0/0 0.0.0.0/0 NETFLOW Chain FW-1-INPUT (1 references) target prot opt source destination NETFLOW all -- 0.0.0.0/0 0.0.0.0/0 NETFLOW ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT udp -- 192.168.3.0/24 0.0.0.0/0 udp dpt:161 ACCEPT tcp -- 192.168.3.0/24 0.0.0.0/0 tcp dpt:161 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:7788 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:694 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:67 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:68 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:1194 ACCEPT tcp -- xx.xx.xx.xx 0.0.0.0/0 tcp dpt:5666 ACCEPT tcp -- xx.xx.xx.xx 0.0.0.0/0 tcp dpt:5666 ACCEPT udp -- xx.xx.xx.xx 0.0.0.0/0 udp dpt:123 ACCEPT udp -- xx.xx.xx.xx 0.0.0.0/0 udp dpt:123 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp multiport dports 4569,5060 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp multiport dports 4569,5060 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited 

我在OUTPUT表中指定了源/目标主机和端口,但没有运气。

在Wanguard服务器上没有 iptables规则。

在防火墙上使用tcpdump并grep'ing为王服务器的IP产量

 openvpn01:/home/gjones # tcpdump -i eth0 |grep 192.168.3.194 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 13:27:57.103687 IP openvpn01.dev.59531 > 192.168.3.194.iop: UDP, length 1464 13:27:57.302686 IP openvpn01.dev.59531 > 192.168.3.194.iop: UDP, length 1464 13:27:57.802683 IP openvpn01.dev.59531 > 192.168.3.194.iop: UDP, length 1464 13:27:58.503707 IP openvpn01.dev.59531 > 192.168.3.194.iop: UDP, length 1464 13:27:59.103688 IP openvpn01.dev.59531 > 192.168.3.194.iop: UDP, length 1464 

在防火墙上运行“netstat -na”并查找“2055”(netflow目标端口)

 udp 0 0 192.168.3.112:59531 192.168.3.194:2055 ESTABLISHED 

在Wanguard服务器上,我也是这样做的:

 # netstat -na |grep 2055 udp 0 0 192.168.3.194:51139 192.168.3.194:2055 ESTABLISHED udp 0 0 192.168.3.194:2055 0.0.0.0:* 

根据Gaumire的要求,这里也是“netstat -uan”

 Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State udp 0 0 192.168.3.194:51139 192.168.3.194:2055 ESTABLISHED udp 0 0 192.168.3.194:2055 0.0.0.0:* udp 0 0 0.0.0.0:111 0.0.0.0:* udp 0 0 192.168.3.194:123 0.0.0.0:* udp 0 0 127.0.0.2:123 0.0.0.0:* udp 0 0 127.0.0.1:123 0.0.0.0:* udp 0 0 0.0.0.0:123 0.0.0.0:* udp 0 0 0.0.0.0:161 0.0.0.0:* udp 0 0 0.0.0.0:631 0.0.0.0:* udp 0 0 0.0.0.0:851 0.0.0.0:* udp 0 0 :::111 :::* udp 0 0 ::1:123 :::* udp 0 0 fe80::2a0:d1ff:fee1:123 :::* udp 0 0 :::123 :::* udp 0 0 :::851 :::* 

请注意,我也已经configuration了一个netuu出口商在wuuard服务器上,这似乎工作(我得到的数据在王德)。

检查WANGuard的日志我看到错误“意外的PDU:src_ip = 192.168.3.112未configuration”谷歌没有任何我能find的东西。

有人能帮我弄清楚错误在哪里?

谢谢,

肯德尔

openvpn01.dev和主机192.168.3.194之间是否有防火墙或某些此类设备? 图表会有所帮助。 如果iptables输出是您的wanguard服务器您的策略设置为接受,所以他们不应该是问题。

服务器上运行的服务是否正在运行。 请以root身份发出以下命令。

 #netstat -tupan | grep 'LIST\|*' 

要检查iptablesconfiguration是否阻塞,通常build议临时禁用iptables(当然,除了NETFLOW规则)。 同时检查dmesg ,因为可能有重要的内核/模块消息。 旧版本的NETFLOW模块应该接口UP 设置sysctl net.netflow.destination 。 尝试手动设置目的地来检查。 或者从git repo尝试最新版本的模块(而不是tar.gz)。 使用cat /proc/net/stat/ipt_netflow检查模块统计信息,了解丢弃的stream或套接字错误。