How can I create Wireshark variables to represent an IP Address? - networking

When analyzing network traffic in Wireshark, it would be helpful on occasion to look at a string variable representing an IP address instead of the actual IPv4/6 address.
In the IP source or destination column, instead of seeing 192.168.1.44, I would like to see "tom's laptop" or "smtp-server". Is this possible? Some type of IP-to-String aliasing?
I understand there is an option to enable name resolution for the Network Layer, this would translate a public IP into its registered domain name. Specifically when dealing with private IP addresses, this would not be helpful.

Related

What is my IP address in CIDR notation?

I'm trying to following the Quick Start Wordpress for Google App Engine guide; however, the Google Cloud Console appears to have changed slightly with respect to the instructions.
One of the instructions is to select Assign IP Address, and add your IP address to the list of Authorized IP Addressed. The link points to a Google search for "what's my IP address". However, the result does not look like it is in CIDR notation as required:
The IP address doesn't have a slash in it as in the CIDR example. Would it be OK just to enter the "public IP address" as it appears in Google search in the Network field?
Update
I tried entering my public IP address, but it appears with the gray italic text "Not saved" (see below), which does not look promising.
Just add '/32' to your ip... so it should be
82.217.236.160/32
I used whois.geektools.com to look up the IP address you mentioned. If that's
your actual IP address, then the IP range assigned to your ISP is:
inetnum: 82.217.192.0 - 82.217.255.255
netname: ZIGGO-CM
If you convert those IP addresses into binary, then the first 18 bits are
constant for that block of addresses, and the other 14 bits could vary, depending on how your ISP dishes them out to their customers.
So 82.217.192.0/18 (your ISP's block of IP addresses, in CIDR notation) might be a more convenient choice than the 82.217.236.160/32 value, corresponding to the single IP address currently assigned to you at the moment.

IP Address: using program or script

A) The below statement
System.out.println(java.net.Inet4Address.getLocalHost());
shows output as myhostname/192.168.1.25
B) The http://whatismyipaddress.com/ shows below (masked):
14x.7x.2xx.x1x
Using above mentioned technique A (any language or script), how do I get the value 14x.7x.2xx.x1x that above mentioned technique B shows? Or, is it at all possible?
In other words (?), using technique A (as mentioned in original question), how I can I get the same public Ip address of my home router which is shown by technique B? If it is impossible, please explain briefly (two lines at the most) why?
Thanks
Refer to this question:Getting the 'external' IP address in Java
The computer don't know its final public address as it is not necessary for it to know. Local network IP Address is sufficient for it for the tasks. But if you want to get the public address you have to use an external service as mentions in the answers of the linked question.
I will assume that you are at your home and you have a router for connecting your several computers to the internet.
http://whatismyipaddress.com/ will show an IP address as it is visible on the global internet. This may well be the IP address of your in-home router, which exposes one address for your entire in-home network. This is your public IP address.
The script that you show will give you the IP address of your own machine, which is usually only useful on your own local network. This is a private IP address, only accessible from your local network.

Is IP address in US grouped by state?

I have our customers iso generated ip addresses where I like to do some analysis to see where our most customers are accessing our site.
I tried to do api calls to
http://ip-api.com/<ip address>
to retrieve the state where the ip address generated but there are over 4 million ip addresses to process and this will take some time.
Are ip addresses designated by State in the US? If first octets are designated to the states, I can then write a script to parse out the ip addresses. Other than api calls to determine the location of the ip address?
I recommend using something like Maxmind that can get the geo-location(city,State) of the IP addresses. They have an API that you can implement into your code to find the location of all IP's in a database.

Does the idea of private ip address in ipv6?

For the idea of private, I mean it like 10.*.*.* idea of ipv4. It seems ipv6 don't conserve ip addresses like these any more.
So, what if I want to create a private subnet which I don't want the others to know my subnet number or access my subnet with ip address. I can create my own range of ip subnet number, but it seems in that way, it would conflicts with global ip address.
I know the idea of link local address, but I think that's useless when I want several links to constitute a network.
If you are just setting up a private local network for development/testing and don't have any actual IPv6 connectivity of your own (or your ISP is stupid and only gave you a /64) then unique local addresses will work fine for you.
However, unique local addresses cannot be used for connectivity to the global Internet. If you need this, you should get global addresses and a proper firewall (as NAT is not needed and strongly discouraged in IPv6).
To get a /48 ULA prefix, visit this generator and throw in a MAC address. (Using a MAC address to generate the prefix is specified by RFC 4193, which defines unique local addresses.)

IP Comparison between 2 Locations

can one location have more than 1 IP address? I have 2 IP addresses and need to know if they originate from the same source. Thanks
You're missing clear definitions of "location" and "source" in your question but lets go with the assumption that you mean "physical machine" for both (as it's obvious that multiple machines will have different addresses and that a single machine can change its IP address over time).
In that case, the answer is yes. The operating system may bind as many IP addresses to a physical network port (and a single MAC -- the physical addressing used by Ethernet) as it wishes.
Binding multiple IP addresses was the standard way of doing "virtual web hosting" before HTTP/1.1 arrived with the "Host" header. The provider would use DNS to map different host names to different IPs on the same network (usually the same subnet as well) and then assign all of them to the same interface. The webserver would get address information from an incoming connection and based on the local IP address would know which virtual host was being accessed.
This led to a higher-than-typical use of public IP addresses but the practice is now gone with the proliferation of HTTP/1.1.
I'm not sure how Windows presents it, but Linux will present a physical interface with multiple IP addresses as multiple logical interfaces such as "eth0", "eth0:1", "eth0:2", etc. Each logical interface has a unique IP address even though they share the same physical interface.
This is hard to tell. Especially it is hard to tell if these IP addresses are from different times. Today I may have a different IP address than tomorrow.
Even they are from the same time, a load balancer im my internal equipment might send my packets over the fail-over line if the 1st one is overloaded or broken down.
One network adapter normally has only one IP address at once and a typical end user only has one network connection active, but even then the IP address can change. The user could switch from wireless to wired and back or a power outage might reset the ISP's DHCP server (assigning everyone a new IP address).
If you want to identify the user even if his IP address changes, you need to identify the user by his session id, stored in cookies. As two users can have the same IP address (a whole company could be behind a NAT), you should never rely on IP addresses for identification.

Resources