Skip to content

Commit 3592ac5

Browse files
committed
update iptables and tcpdump usage.
1 parent a063461 commit 3592ac5

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

bashrc/oneline_cmd

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ ip ro add 10.0.0.0/8 via 10.11.11.254
3535
ip route | while read p; do echo "ip route change $p initcwnd 10 initrwnd 10"; done
3636

3737
#tcpdump
38+
#tcpdump [ -AdDeflLnNOpqRStuUvxX ] [ -c count ]
39+
# [ -C file_size ] [ -F file ]
40+
# [ -i interface ] [ -m module ] [ -M secret ]
41+
# [ -r file ] [ -s snaplen ] [ -T type ] [ -w file ]
42+
# [ -W filecount ]
43+
# [ -E spi@ipaddr algo:secret,... ]
44+
# [ -y datalinktype ] [ -Z user ]
45+
# [ expression ]
46+
# expression (type:net,host,port) (dir:src,dst,src and dst, src or dst) (proto)
47+
#
3848
tcpdump tcp and src 192.168.0.1 and port 80
3949
# 0x4745 : [GE]T -- 0x4854 : [HT]TP
4050
tcpdump -XvvennSs 0 -i eth0 tcp[20:2]=0x4745 or tcp[20:2]=0x4854
@@ -45,13 +55,14 @@ tcpdump -nnvXSs 0 -c2 icmp
4555
tcpflow -cp -i eth0 "port 80"
4656

4757
#iptables
58+
#iptables [-t table] command [match] [target/jump]
59+
# -t --table: table(filter, nat, mangle, raw)
60+
# -A -D -I -R: chain -L,--lsit,-F,--flush,-Z,-N,-X,-P,-E
61+
# match regx: tcp,udp,icmp,limit,mac,mark,owner,state,tos,ttl
62+
# -j target:(ACCEPT, DROP, REJECT)
4863
iptables -A INPUT -p tcp --dport 80 -m time --timestart 09:00 --timestop 18:00 -j DROP
4964
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport 22 -j ACCEPT
5065
iptables -t filter -A INPUT -s 192.168.1.1 -j DROP
51-
#-t --table: table(filter, nat, mangle, raw)
52-
#-A -D -I -R: chain
53-
#match regx
54-
#action (ACCEPT, DROP, REJECT)
5566

5667
#RAID0
5768
mdadm -C /dev/md0 -a yes -l 0 -n 2 /dev/sdb /dev/sdc

0 commit comments

Comments
 (0)