1.problem:
[root@fundation10 Desktop]# tcpdump dst port 9090
tcpdump: WARNING: enp0s25: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp0s25, link-type EN10MB (Ethernet), capture size 65535 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
2.how to solve the problem
from online
1. 是有反应的,你可以另开终端,ping 91.189.89.144;你这里告警了eth0: no IPv4 address assigned,eth0网卡有IPv4地址吗?tcpdump -D可以列出所有的网卡信息,看你10.172.3.29是哪个网卡的IP,“tcpdump -i 网卡前数字或网卡名 host 10.172.3.29 and 91.189.89.144”试试;
2. 上面解决了再说这个,你可以另开终端,ping 91.189.89.144,再捕获试试;
3. host表示单个主机,也就是单个IP地址;
4. host是单个主机,net是子网(多个IP地址);
详细的你可以搜一下tcpdump教程
我使用了第一种方法解决了问题:
步骤:
1.列出所有网卡信息
[root@fundation10 Desktop]# tcpdump -D
1.enp0s25
2.br0
3.virbr0
4.bluetooth0 (Bluetooth adapter number 0)
5.nflog (Linux netfilter log (NFLOG) interface)
6.nfqueue (Linux netfilter queue (NFQUEUE) interface)
7.usbmon1 (USB bus number 1)
8.usbmon2 (USB bus number 2)
9.wlp3s0
10.any (Pseudo-device that captures on all interfaces)
11.lo
2.指定网卡查询,效果如下:
[root@fundation10 Desktop]# tcpdump -i 11 dst port 9090
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
18:42:00.637845 IP localhost.45522 > localhost.websm: Flags [S], seq 3537773743, win 43690, options [mss 65495,sackOK,TS val 63661 ecr 0,nop,wscale 7], length 0
18:42:00.637878 IP localhost.45522 > localhost.websm: Flags [.], ack 3839637389, win 342, options [nop,nop,TS val 63661 ecr 63661], length 0
18:42:42.054341 IP localhost.45522 > localhost.websm: Flags [P.], seq 0:6, ack 1, win 342, options [nop,nop,TS val 105078 ecr 63661], length 6
18:42:52.615637 IP localhost.45522 > localhost.websm: Flags [F.], seq 6, ack 1, win 342, options [nop,nop,TS val 115639 ecr 105078], length 0
18:42:52.615702 IP localhost.45522 > localhost.websm: Flags [.], ack 2, win 342, options [nop,nop,TS val 115639 ecr 115639], length 0
^C
5 packets captured
10 packets received by filter
0 packets dropped by kernel
参考http://bbs.csdn.net/topics/390452213