Книга: Linux Network Administrator Guide, Second Edition
Accounting by Protocol
Accounting by Protocol
Let's now imagine that we are interested in knowing how much of the traffic on our link is TCP, UDP, and ICMP. We would use rules like the following:
# ipfwadm -A both -a -W ppp0 -P tcp -D 0/0
# ipfwadm -A both -a -W ppp0 -P udp -D 0/0
# ipfwadm -A both -a -W ppp0 -P icmp -D 0/0
or:
# ipchains -A forward -i ppp0 -p tcp -d 0/0
# ipchains -A forward -i ppp0 -p udp -d 0/0
# ipchains -A forward -i ppp0 -p icmp -d 0/0
or:
# iptables -A FORWARD -i ppp0 -m tcp -p tcp
# iptables -A FORWARD -o ppp0 -m tcp -p tcp
# iptables -A FORWARD -i ppp0 -m udp -p udp
# iptables -A FORWARD -o ppp0 -m udp -p udp
# iptables -A FORWARD -i ppp0 -m icmp -p icmp
# iptables -A FORWARD -o ppp0 -m icmp -p icmp
With these rules in place, all of the traffic flowing across the ppp0 interface will be analyzed to determine whether it is TCP, UDP, or IMCP traffic, and the appropriate counters will be updated for each. The iptables example splits incoming flow from outgoing flow as its syntax demands it.
- Accounting by Service Port
- Accounting of ICMP Datagrams
- Dynamic Host Configuration Protocol
- Complex protocols and connection tracking
- Understanding Point-to-Point Protocol over Ethernet
- 14.3.1. gdb Remote Serial Protocol
- 8.4. Настройка DHCP (Dynamic Host Configuration Protocol)
- Using a USB Protocol Analyzer
- 2.1. LAYERED PROTOCOLS
- 7.5.3. The Fast Local Internet Protocol
- Chapter 8. The Point-to-Point Protocol
- Chapter 10. IP Accounting