First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

How to create a filter in Wireshark traffic coming from the internet vs from internal/private IP addresses

  • retag add tags

Hello All,

How to create a filter in Wireshark traffic coming from the internet vs from internal/private IP addresses

Thanks Pranav

pranav_sk's avatar
1
pranav_sk
asked 2018-03-17 21:23:33 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Capture filter syntax: src net not (192.168.0.0/16 or 172.16.0.0/12 or 10.0.0.0/8) or dst net not (192.168.0.0/16 or 172.16.0.0/12 or 10.0.0.0/8)

Display filter syntax: !ip.src in {192.168.0.0/16 172.16.0.0/12 10.0.0.0/8} or !ip.dst in {192.168.0.0/16 172.16.0.0/12 10.0.0.0/8}

sindy's avatar
6.2k
sindy
answered 2018-03-18 08:20:20 +0000
edit flag offensive 0 remove flag delete link

Comments

And now for IPv6?

Jaap's avatar Jaap (2018-03-18 09:31:27 +0000) edit

Is this an exam or what :-) ? In IPv6 it would depend on site individual configuration as even site-local addresses are normally public, except fc00::/7 which, however, are unlikely to be used in networks which do have an IPv6 uplink.

So src net not (fc00::/7 or xxxx:xxxx:xxxx:xxxx::/64) or dst net not (fc00::/7 or xxxx:xxxx:xxxx:xxxx::/64) or, respectively, !ipv6.src in {fc00::/7 xxxx:xxxx:xxxx:xxxx::/64} or !ipv6.dst in {fc00::/7 xxxx:xxxx:xxxx:xxxx::/64}, where xxxx:xxxx:xxxx:xxxx is the site prefix, should be the correct answer.

It is true that I've also neglected the possibility that "internal" IPv4 addresses might be public ones as well.

sindy's avatar sindy (2018-03-18 10:59:31 +0000) edit

An exam? Maybe :-) In a single broadcast domain the link local address is enough to filter the traffic. Every interface has one and it should be used for local traffic. So any non-local address should be related to external traffic. The problems start with a routed internal network. Then you'll have to know which subnet is assigned to your network, to know what's outside, being the internet.

Jaap's avatar Jaap (2018-03-18 12:33:03 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer