Get information about your network interface with Linux.

Linux has quite a few commands for finding out information about your network adapters. Below is an example. Using the ethtool command as root. homer@deusexmachina ~ $ sudo ethtool eth2 [sudo] password for homer: Settings for eth2: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supported pause frame use: No … Read more

How to calculate an IP subnetwork with the sipcalc command.

The sipcalc command is very useful for calculating an IP subnet. This command shows the amount of hosts available for a given subnet. root@debian:/home/homer# sipcalc 192.168.100.1/24 -[ipv4 : 192.168.100.1/24] – 0   [CIDR] Host address – 192.168.100.1 Host address (decimal) – 3232261121 Host address (hex) – C0A86401 Network address – 192.168.100.0 Network mask – 255.255.255.0 … Read more

How to get the geographical location of an IP address.

How to get the geographical location of an IP address. This simple command will get this for you. [jason@darknet:~] curl ipinfo.io/203.113.124.148 ; echo "" { "ip": "203.113.124.148", "hostname": "No Hostname", "city": "", "region": "", "country": "TH", "loc": "13.7500,100.4667", "org": "AS9737 TOT Public Company Limited" }[jason@darknet:~] curl ipinfo.io/203.113.124.148 ; echo "" { "ip": "203.113.124.148", "hostname": "No … Read more

Another way to print your IP address in Linux. This is a very useful one liner.

This simple one liner will print out your IP address and then IPv6 equivalent if you have it set. [homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283[homer@localhost ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283 Here … Read more

How to renew your network interface IP address on Linux with the dhclient command.

The dhclient command on Linux is used to renew an IP address for a network interface. Here i am using Fedora 19 with the new standardised network interface names. root@neo homer# dhclient -v wlp0s26f7u5 Internet Systems Consortium DHCP Client 4.2.5 Copyright 2004-2013 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/   Listening … Read more

Iron Man 3 computer portrayal and the use of IP addresses in the movie.

The Iron man 3 movie shows Tony Stark using a computer with IP addresses that have numbers greater than 255. This is not possible; the largest number you can have is 255.255.255.0 There is another scene where he is using Speedtest.net. This is a strange thing for a defense login screen to have. The main … Read more

Converting IP addresses from decimal to binary with pen and paper. The old fashioned way.

One important skill in computer networking is converting an IP address to binary from decimal. Here is an example. 172.124.64.2 This IP address converts into this binary number. 10101100.01111100.01000000.00000010 The way I find is the easiest with pen and paper is to write down this number sequence. 128 – 64 – 32 – 16 – … Read more

Networking script I am working on. This prints some information about your machine.

This Perl script will print some information about your networking set-up on your Linux machine. #!/usr/bin/perl   use warnings;   $iface = "eth0";   @data = `ifconfig`;   $net = $data[1];   $kernel = `uname -r`;   printf("\n*————————————-*\n");   printf("The IP of %s is:%s\n", $iface, $net); printf("The kernel version is: %s\n", $kernel);   printf("\n*————————————-*\n");#!/usr/bin/perl use … Read more

Some more useful Linux commands that are very useful indeed.

Using the Linux last command to view re-boot history. C:\HOME\FLYNN\DOCUMENTS> last reboot reboot system boot 3.4.0-rc2-bejiit Sat Aug 4 12:50 – 14:29 (01:39) reboot system boot 3.4.0-rc2-bejiit Fri Aug 3 21:11 – 21:16 (00:05) reboot system boot 3.4.0-rc2-bejiit Fri Aug 3 20:21 – 20:57 (00:36) reboot system boot 3.4.0-rc2-bejiit Fri Aug 3 11:35 – 20:00 … Read more