210-255 · Question #114
Which expression creates a filter on a host IP address or name?
The correct answer is A. [src|dst] host <host host >. In Berkeley Packet Filter syntax used by tcpdump and Wireshark, the 'host' primitive with an optional src or dst qualifier filters traffic by IP address or hostname.
Question
Which expression creates a filter on a host IP address or name?
Options
- A[src|dst] host <host host >
- B[tcp|udp] [src|dst] port<port>
- Cether [src|dst] host<ehost>
- Dgateway host <host>
How the community answered
(54 responses)- A91% (49)
- B2% (1)
- C2% (1)
- D6% (3)
Why each option
In Berkeley Packet Filter syntax used by tcpdump and Wireshark, the 'host' primitive with an optional src or dst qualifier filters traffic by IP address or hostname.
The expression '[src|dst] host <host>' matches packets where the specified IP address or resolvable hostname appears as the source, the destination, or either endpoint, making it the correct primitive for host-based filtering. This is part of the BPF filter language used by tcpdump and Wireshark, where the optional src or dst qualifier restricts matching to one traffic direction. Without a qualifier, both directions are matched by default.
This expression filters by TCP or UDP port number using the port primitive, not by IP address or hostname.
The 'ether host' primitive filters on Layer 2 Ethernet MAC addresses, not on Layer 3 IP addresses or hostnames.
The 'gateway host' primitive matches packets that were routed through a specific intermediate host, which tests routing path rather than source or destination identity.
Concept tested: BPF pcap filter syntax for host-based capture
Source: https://www.tcpdump.org/manpages/pcap-filter.7.html
Topics
Community Discussion
No community discussion yet for this question.