Featured »

March 2, 2022 – 2:00 pm

Books have been written on the subject of awk and sed. Here’s a small sample of commands I put together over the years that are useful for everyday system administration tasks. Most of these tasks …

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Archive by Category

Articles in Networking

NFS I/O Stats with Logging

January 3, 2022 – 1:43 pm
tq9mhhd5xy2q0kto2j1785n6odv[1]

The nfsiostat is an excellent tool for analyzing NFS performance. The only major problem with this utility is that it’s designed to be used interactively. It does not have logging or timestamping capabilities. I needed …

Inventorying NFS Mounts and Mount Options

December 26, 2021 – 1:41 pm
4ucne6vs8m7hqdl0el9ddqd1sql[1]

As time goes by, NFS mounts multiply like rabbits. Added by many different people over the years, these entries present a dizzying variety of mount options – most are a copy-paste job that makes little …

Generating IP Whitelists

October 7, 2021 – 11:44 am
sonlxanvz0en50ijq03cedkaz2e[1]

I have several scripts that scan various log files for signs of suspicious activity and block the offending IPs on my Web servers – pretty standard stuff. The trick, of course, is not to block …

Validating HTTPS Cache Peers for Squid

January 6, 2020 – 12:38 am
sy2zeb1vp2h8itlxfbbylw0jrm0[1]

I have a squid proxy server that uses a long list of authenticated cache peers in a round-robin configuration. The process looks something like this:

Verifying SNMP Connectivity on Multiple Hosts

December 19, 2019 – 9:50 pm
Photo-2019-10-07-14-39-03_0266[1]

I needed to check if SNMP was accessible on whatever live servers that existed in a particular subnet. Here’s a quick script to do this.

Bulk-Adding IPTables Rules

December 12, 2019 – 9:46 pm
b3gk9tc9x14ki5xa4bx8c4v1b66[1]

I’ve been using my mod of this handy script to block countries with iptables. One issue with the script is that it is adding rules one-by-one using the iptables -A syntax. This is the proper …

Automatically Block Frequent Visitors

December 9, 2019 – 9:45 pm
gea59uduencunzibzb6i3gxn36m[1]

I had a few similar scripts floating around this site, but this one is a bit more all-inclusive and better organized. The script will analyze your firewall/whatever access log and block particularly active visitors.

Working with iptables Logging

November 30, 2019 – 9:41 pm
gpxvtms6cvea4q504jtbxjfwcd5z-2[1]

Most commonly iptables is used to allow, block, or redirect connections. However, it also has a logging feature that can be very useful for network traffic analysis and system security.

Analyzing Network Performance

November 25, 2019 – 9:37 pm
gly8stqifn615gp3xbc34h64byx-2[1]

Much of network performance analysis will be comparative in nature. Thus, seeing the output of multiple commands side by side can be quite useful. Bash has a useful little utility called pr and we’ll make …

Adding and Removing sshd instances on CentOS 7

June 20, 2019 – 11:09 am
gtmwo2mvag6419w36e4wqir67iu

As a follow-up to my previous post about adding sshd instances on CentOS 5 & 6, here’s a script that does the same on RHEL/CentOS 7.

Adding and Removing sshd instances on CentOS 6

April 20, 2019 – 8:24 pm
Photo-2019-03-25-20-44-06_2465

This is a process and a couple of script to allow you to setup an additional sshd service on an alternate port.

Measure DNS Server Performance

March 25, 2019 – 4:04 pm
Tangled FX 2.1.2 (Jan 10, 2019 at 6:31:40 PM) B & W Etching preset

This is not an entirely proper way to benchmark a DNS server, but, in a pinch, it should give you some idea of its responsiveness and stability.

Inventory Network Services with Nmap

January 14, 2019 – 4:32 pm
dg7fhku552hsa11yayxb6voyf3i

With the growing number of network-enabled devices in your home, meaningful security becomes elusive. The first step to addressing the situation is knowing what you have. A few examples below use the nmap utility to scan your local network and detect active devices and services.

Verify Network Port Access

August 8, 2018 – 4:15 pm
q5yhi1e570yliip0lf9srnrm6jh

There are several tools you can use to verify access to a remote network port: nc, tcping, telnet. Unfortunately, nc from the netcat package has been replaced by the one from nmap, which lacks the -z option, making …

Detect SSL Certificate Injection

February 21, 2018 – 3:05 pm
spy

When the SSL Digital Certificate is intercepted and replaced by a device between your browser and the Web site, we call it certificate injection. This method is more commonly used not by hackers, but by …

Extracting Email Addresses from TCP Streams

December 5, 2017 – 7:06 pm
shell

Here’s a quick example of using tshark to extract email addresses from TCP streams. Let’s say some application on your server is sending emails and you want to find out who is receiving those emails. …

Occupy Subnet

December 1, 2017 – 2:15 pm
DSC_6214 copy copy

The script below (tested on RHEL 7) will use arp-scan to identify unused IPs on your subnet and configure virtual interfaces attached to your primary NIC to take over every available IP. 

Using IPTables to Allow Access to Private Networks

June 22, 2017 – 9:46 am
network_cable_01

Below is a quick example of how to use iptables to allow port access for all types of private networks. In this case we’re allowing access to ports 10000 and 20000, commonly used by webmin and usermin.

Sun T-Series ILOM and Solaris 11 Network Configuration

February 20, 2017 – 11:16 am
HP-Greets-IBM-2

Just some quick notes on setting up Oracle Sun T-series server ILOM and network aggregation with LACP. I don’t get to do this very often, so every time it’s a struggle to remember, with much …

Tracking Emails in Postfix Logs

October 27, 2016 – 6:02 pm
postfix_logo

Depending on your Postfix configuration, the same email may cycle through the postfix queue several times, changing it’s queue ID and making it difficult to track. For example, if you have Amavis configured for spam and …

Socket Statistics ss Command

July 11, 2016 – 8:10 pm
network_005

This is a small collection of useful ss (written by Alexey Kuznetsov of the Russian Nuclear Research Institute) syntax examples that go beyond the basics covered by other sources. Here’s one I use often: it shows established connections to …

Fixing NIC Name in Cloned VMWare Linux Machines

June 28, 2016 – 12:32 pm
network switch

A suspected bug with certain versions of VMware ESX causes cloned Linux VMs to obtain a sequentially-number NIC. For example, if the parent VM had eth0, the clone will have eth1, and the clone of …