Posted: . At: 10:21 AM. This was 4 years ago. Post ID: 14163
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Get the geographical location of an IP address and other networking tricks.


To get the geographical location of an IP address, use this command. This uses ipinfo.io and gets a lot of information about the IP address.

4.4 Tue Mar 17 jason@Yog-Sothoth 0: $ curl -s ipinfo.io/203.113.124.148 | awk '{print $2}' | sed 's/"//g'
 
203.113.124.148,
203-113-124-148.revip.totidc.net,
Bangkok,
Bangkok,
TH,
13.7540,100.5014,
AS131293
10100,
Asia/Bangkok,
https://ipinfo.io/missingauth

To get just the location, use this version.

4.4 Tue Mar 17 jason@Yog-Sothoth 0: $ curl ipinfo.io/98.137.246.8/loc
40.7293,-73.9874

This prints the geographical location of the Yahoo server.

Send a very long message as an arbitrary ICMP ping packet. This is a very fun networking trick.

4.4 Tue Mar 17 jason@Yog-Sothoth 0: $ sudo nping -c 1 --data-string "Hello World. This is a custom ICMP packet. I love sending this stuff. You can use a long string as well. Very long indeed. So long, it bloats the packet quite a bit, but still works fine." --tcp -p 80,443 192.168.1.2
 
Starting Nping 0.7.60 ( https://nmap.org/nping ) at 2020-03-17 09:35 AEDT
SENT (0.0405s) TCP 192.168.1.2:36092 > 192.168.1.2:80 S ttl=64 id=64224 iplen=227  seq=3300324878 win=1480 
RCVD (0.2267s) TCP 192.168.1.2:80 > 192.168.1.2:36092 SA ttl=64 id=0 iplen=44  seq=1123801034 win=65495 <mss 65495>
SENT (1.0407s) TCP 192.168.1.2:36092 > 192.168.1.2:443 S ttl=64 id=64224 iplen=227  seq=3300324878 win=1480 
RCVD (1.0427s) TCP 192.168.1.2:443 > 192.168.1.2:36092 RA ttl=64 id=0 iplen=40  seq=0 win=0 
 
Max rtt: 186.103ms | Min rtt: 1.949ms | Avg rtt: 94.026ms
Raw packets sent: 2 (454B) | Rcvd: 2 (84B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 1.09 seconds

Calculate an IP address subnetting split. This is a royal pain, but sipcalc makes this easier.

4.4 Tue Mar 17 jason@Yog-Sothoth 1: $ sipcalc -s27 192.168.0.1/24
-[ipv4 : 192.168.0.1/24] - 0
 
[Split network]
Network			- 192.168.0.0     - 192.168.0.31
Network			- 192.168.0.32    - 192.168.0.63
Network			- 192.168.0.64    - 192.168.0.95
Network			- 192.168.0.96    - 192.168.0.127
Network			- 192.168.0.128   - 192.168.0.159
Network			- 192.168.0.160   - 192.168.0.191
Network			- 192.168.0.192   - 192.168.0.223
Network			- 192.168.0.224   - 192.168.0.255

Split a network into 3 networks, with 10, 20 and 30 hosts in each.

4.4 Tue Mar 17 jason@Yog-Sothoth 1: $ ipcalc 192.168.1.0/24 -s 10 20 30
Address:   192.168.1.0          11000000.10101000.00000001. 00000000
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.1.0/24       11000000.10101000.00000001. 00000000
HostMin:   192.168.1.1          11000000.10101000.00000001. 00000001
HostMax:   192.168.1.254        11000000.10101000.00000001. 11111110
Broadcast: 192.168.1.255        11000000.10101000.00000001. 11111111
Hosts/Net: 254                   Class C, Private Internet
 
1. Requested size: 10 hosts
Netmask:   255.255.255.240 = 28 11111111.11111111.11111111.1111 0000
Network:   192.168.1.64/28      11000000.10101000.00000001.0100 0000
HostMin:   192.168.1.65         11000000.10101000.00000001.0100 0001
HostMax:   192.168.1.78         11000000.10101000.00000001.0100 1110
Broadcast: 192.168.1.79         11000000.10101000.00000001.0100 1111
Hosts/Net: 14                    Class C, Private Internet
 
2. Requested size: 20 hosts
Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Network:   192.168.1.0/27       11000000.10101000.00000001.000 00000
HostMin:   192.168.1.1          11000000.10101000.00000001.000 00001
HostMax:   192.168.1.30         11000000.10101000.00000001.000 11110
Broadcast: 192.168.1.31         11000000.10101000.00000001.000 11111
Hosts/Net: 30                    Class C, Private Internet
 
3. Requested size: 30 hosts
Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Network:   192.168.1.32/27      11000000.10101000.00000001.001 00000
HostMin:   192.168.1.33         11000000.10101000.00000001.001 00001
HostMax:   192.168.1.62         11000000.10101000.00000001.001 11110
Broadcast: 192.168.1.63         11000000.10101000.00000001.001 11111
Hosts/Net: 30                    Class C, Private Internet
 
Needed size:  80 addresses.
Used network: 192.168.1.0/25
Unused:
192.168.1.80/28
192.168.1.96/27
192.168.1.128/25

The sipcalc and ipcalc utilities would be very useful for Cisco networking students. Unless you use ccna5 cheat websites, which people deny, but I am sure many use it. It is the first result in Google. I guess it would not happen if Cisco used randomly selected questions in an exam, which would be still within the studied chapters, but selected random questions instead of using the same questions all the time. This would be fine. The questions would still address the material that the student was hopefully studying, but they would not know what questions would actually be asked in the exam. Instead of using the same exam over again, that can be in a test bank. I think this might work and would help eliminate cheating. Of course, if someone cheats to get past the easy exams, they will be defeated by harder examinations later. And might be defeated by tasks in the workplace. If Cisco networking and subnetting is not your strength, and binary is hard sometimes, then find something else you are good at. Try cheating on the OSCP or RHCSA or LFCSA. It basically can’t be done, because if you can do all the things they ask on there you are by definition knowledgeable in the areas they require. So I think that testing practical knowledge is the key. Instead of multiple-choice exams, instead, test the actual knowledge of the candidate and see if they have actually been studying and learning, instead of just reading dumps from ccna5. This would work very well to catch cheating.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.