Cheetsheet of Linux shell commands that I use to investigate my workstation networking configuration.
I use the ip command rather than the legacy ifconfig variant.
These commands were particularly useful for setting up my Wireguard VPN AppVM on my QubesOS workstation. I ran each of the below commands in my regular sys-net AppVM/ProxyVM, then ran the same commands in my sys-vpn AppVM. After that, I opened a browser in a connected AppVM and opened a search engine to generate some traffic, then ran the commands again to compare the difference.
Table of Contents
Command: ip
Optional: Include the -br flag to keep the output compact.
List available interfaces: ip link
ip -br link
#> lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
#> eth0 UP 00:16:3e:5e:6c:00 <BROADCAST,MULTICAST,UP,LOWER_UP>
#> docker0 UP 02:42:2d:26:d2:cf <BROADCAST,MULTICAST,UP,LOWER_UP>
#> veth32d23e0@if4 UP 12:81:f9:cc:83:d1 <BROADCAST,MULTICAST,UP,LOWER_UP>
#> veth390c339@if6 UP 0a:d6:90:47:12:9d <BROADCAST,MULTICAST,UP,LOWER_UP>
List local network IP addresses per interface: ip addr
ip -br addr
#> lo UNKNOWN 127.0.0.1/8 ::1/128
#> eth0 UP 10.137.0.10/32 fe80::216:3eff:fe5e:6c00/64
#> docker0 UP 172.17.0.1/16 fe80::42:2dff:fe26:d2cf/64
#> veth32d23e0@if4 UP fe80::1081:f9ff:fecc:83d1/64
#> veth390c339@if6 UP fe80::8d6:90ff:fe47:129d/64
List routing rules: ip route
ip route
#> default via 10.137.0.16 dev eth0
#> 10.137.0.16 dev eth0 scope link
#> 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
sudo iptables -vL -n -t nat
user@d9-workstation:~$ sudo iptables -vL -n -t filter
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 PR-QBS all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 PR-QBS-SERVICES all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 DOCKER all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 640 packets, 38019 bytes)
pkts bytes target prot opt in out source destination
0 0 DOCKER all -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * !docker0 172.17.0.0/16 0.0.0.0/0
0 0 ACCEPT all -- * vif+ 0.0.0.0/0 0.0.0.0/0
1 52 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
640 38019 MASQUERADE all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 MASQUERADE tcp -- * * 172.17.0.2 172.17.0.2 tcp dpt:8888
0 0 MASQUERADE tcp -- * * 172.17.0.3 172.17.0.3 tcp dpt:1313
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- docker0 * 0.0.0.0/0 0.0.0.0/0
0 0 DNAT tcp -- !docker0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:8888 to:172.17.0.2:8888
0 0 DNAT tcp -- !docker0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1313 to:172.17.0.3:1313
Chain PR-QBS (1 references)
pkts bytes target prot opt in out source destination
Chain PR-QBS-SERVICES (1 references)
pkts bytes target prot opt in out source destination
Misc
Check network connectivity: ping
ping -c 3 8.8.8.8
#> PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
#> 64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=459 ms
#> 64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=482 ms
#> 64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=293 ms
#> --- 8.8.8.8 ping statistics ---
#> 3 packets transmitted, 3 received, 0% packet loss, time 2000ms
#> rtt min/avg/max/mdev = 293.825/412.069/482.818/84.148 ms
Check NAT and network path: traceroute
traceroute 8.8.8.8
#> traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
#> 1 10.64.0.1 (10.64.0.1) 409.712 ms 409.590 ms 409.520 ms
#> 2 198.144.156.1 (198.144.156.1) 409.425 ms 409.352 ms 409.257 ms
#> 3 C3MR6.YesUP.com (166.48.160.6) 409.180 ms 409.084 ms 409.008 ms
#> 4 ae0-130.cr0-tor1.ip4.gtt.net (173.241.129.13) 408.931 ms 408.847 ms 408.767 ms
#> 5 et-0-0-67.cr7-chi1.ip4.gtt.net (89.149.140.197) 408.717 ms 408.648 ms 408.564 ms
#> 6 as15169.chi11.ip4.gtt.net (199.229.231.234) 408.482 ms 410.680 ms 410.578 ms
#> 7 108.170.243.174 (108.170.243.174) 410.684 ms 108.170.244.1 (108.170.244.1) 410.553 ms 108.170.243.225 (108.170.243.225) 410.594 ms
#> 8 209.85.250.165 (209.85.250.165) 410.549 ms 209.85.254.181 (209.85.254.181) 410.484 ms 72.14.236.65 (72.14.236.65) 410.507 ms
#> 9 google-public-dns-a.google.com (8.8.8.8) 410.425 ms 410.404 ms 410.356 ms
DNS server interrogation: nslookup
Click 'output' button for sample results
command
output
1 2 3 4 5
# Install dnsutils to access the nslookup, dig and other similar commands
sudo apt-get -y install dnsutils
# Check Google's DNS
nslookup 8.8.8.8
Wireguard is a new-age VPN protocol that is fast and secure. Here’s how to seamlessly integrate this as a Debian-based AppVM in your QubesOS R4 network stack using Mullvad VPN as the service provider.
Getting your website or blog indexed by search engines is achieved by requesting indexing via their webmaster tools, as well as adding code snippets into page headers. Here’s how to implement it on your Hugo site!
0x666f6f (‘foo’) is my latest blog using a simple static Hugo-generated website; written, deployed and hosted with the power of Git and Bitbucket.io!
All blogs need refreshing over time. My previous blog, MissingLink.xyz, was a Wordpress site of Linux-based experiments with full disk encryption (‘FDE’) using the GRUB2 bootloader. This blog will continue that tradition; documenting various tech projects that I work on in my spare time.
Here’s what you can expect to find; eventually. :)
A how-to for the website setup. This includes setting up my development environment and necessary accounts; establishing the Git workflow; setting up and testing the Hugo static site generator; and using Bitbucket Pipelines to deploy the Hugo output to Bitbucket.io (aka ‘Bitbucket Pages’ after its Github equivalent).
Device and Linux system configuration how-tos. These include advanced GRUB2 full disk encryption and multibooting; setting up QubesOS (R4.0) as my desktop environment; setting up a home theatre PC (HTPC) using SparkyLinux (Debian Stretch); and setting up a network attached storage (NAS) node on my local network.
Coding and Data Science projects. This includes experiments with the Python Scikit Learn library (‘sklearn’); and the Enigma Catalyst blockchain trading API framework.
Computer Numeric Control (CNC) router construction. This is a long-term project involving designing and building a CNC router and many constituent components; including spindle, power supply and electronics.