xml地图|网站地图|网站标签 [设为首页] [加入收藏]

解决办法,使用iptables统计流量

来源:http://www.ccidsi.com 作者:最新解决方案 人气:60 发布时间:2019-10-09
摘要:#增加注入/出的iptables准则 未果原因: $ iptables -I INPUT -d 192.168.1.100 $ iptables -I OUTPUT -s 192.168.1.100 1.telnet包未设置,检查telnet包是还是不是安装:   #查阅流量 [root@vm-rhel root]# rpm -qa telne

#增加注入/出的iptables准则

未果原因:

  1. $ iptables -I INPUT -d 192.168.1.100

  2. $ iptables -I OUTPUT -s 192.168.1.100

1.telnet包未设置,检查telnet包是还是不是安装:  

#查阅流量

[root@vm-rhel root]# rpm -qa telnet
 telnet-0.17-25
  1. $ iptables -nvx -L

 表示已安装

#解除准绳

 2.telnet包已安装,telnet-server未安装,检查telnet-server包是不是安装: 

  1. $ iptables -F

  2. $ iptables -I FORWARD -s 192.168.1.100 -j ACCEPT

  3. $ iptables -I FORWARD -d 192.168.1.100 -j ACCEPT

  4. $ sudo iptables -t filter -A INPUT -p all -s 174.121.79.132 -j ACCEPT

  5. $ sudo iptables -t filter -A OUTPUT -p all -d 174.121.79.132 -j ACCEPT

[root@vm-rhel root]# rpm -qa telnet-server
 telnet-server-0.17-25

除去法则的格局

 表示已设置

措施一的语法是:

 3.telnet配置文件难题:

iptables -D chain rulenum [options]

[root@vm-rhel root]# cat /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses 
#    unencrypted username/password pairs for authentication.
service telnet
{
    flags        = REUSE
    socket_type    = stream        
    wait        = no
    user        = root
    server        = /usr/sbin/in.telnetd
    log_on_failure     = USERID
    disable        = yes 
}

在那之中, chain是链的野趣,正是INPUT FO凯雷德WA凯雷德D 之类的;rulenum 是平整的编号,从1 上马,能够运用--line-numbers 列出准绳的号码。比如列出INPUT 链全体的条条框框:

将disable对应的值修改为no也许注释该行一视同仁启xinetd守护进度:service xinetd restart。

  1. $ iptables -L INPUT --line-numbers

4.Linux防火墙原因,查看防火墙状态:

2.

[root@vm-rhel root]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
target prot opt source destination 
RH-Lokkit-0-50-INPUT all -- anywhere anywhere

  1. num target prot opt source destination

  2. 1 REJECT tcp -- anywhere anywhere tcp dpt:microsoft-ds reject-with icmp-port-unreachable

  3. 2 REJECT tcp -- anywhere anywhere tcp dpt:135 reject-with icmp-port-unreachable

  4. 3 REJECT tcp -- anywhere anywhere tcp dpt:netbios-ssn reject-with icmp-port-unreachable

  5. 4 REJECT udp -- anywhere anywhere udp dpt:microsoft-ds reject-with icmp-port-unreachable

  6. 5 REJECT udp -- anywhere anywhere udp dpt:135 reject-with icmp-port-unreachabl

Chain FORWARD (policy ACCEPT)
target prot opt source destination 
RH-Lokkit-0-50-INPUT all -- anywhere anywhere

删去钦点行准绳:

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

  1. $ iptables -D INPUT 4

Chain RH-Lokkit-0-50-INPUT (2 references)
target prot opt source destination 
ACCEPT udp -- 192.168.1.1 anywhere udp spt:domain dpts:1025:65535 
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN 
ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN 
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp flags:SYN,RST,ACK/SYN 
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh flags:SYN,RST,ACK/SYN 
ACCEPT tcp -- anywhere anywhere tcp dpt:telnet flags:SYN,RST,ACK/SYN 
ACCEPT udp -- anywhere anywhere udp spts:bootps:bootpc dpts:bootps:bootpc 
ACCEPT udp -- anywhere anywhere udp spts:bootps:bootpc dpts:bootps:bootpc 
ACCEPT all -- anywhere anywhere 
ACCEPT all -- anywhere anywhere 
REJECT tcp -- anywhere anywhere tcp dpts:0:1023 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable 
REJECT tcp -- anywhere anywhere tcp dpt:nfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable 
REJECT udp -- anywhere anywhere udp dpts:0:1023 reject-with icmp-port-unreachable 
REJECT udp -- anywhere anywhere udp dpt:nfs reject-with icmp-port-unreachable 
REJECT tcp -- anywhere anywhere tcp dpts:x11:6009 flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable 
REJECT tcp -- anywhere anywhere tcp dpt:xfs flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable

本文由68399皇家赌场发布于最新解决方案,转载请注明出处:解决办法,使用iptables统计流量

关键词: 68399皇家赌场

最火资讯