Pages

HP-UX ephemeral port range for TCP/UDP connections

For HP-UX (click here for latest release) you can tune the UDP local ephemeral port range separately from the TCP local ephemeral port range.

In a previous post it was shown how to alter/view the ephemeral port range for a Linux system.

To follow up the example from my Linux post in order to set on HP-UX the local port range from 15000 till 61000 we can use the ndd utility for the change on the fly.

For TCP we use:
#/usr/bin/ndd -set /dev/tcp tcp_smallest_anon_port 15000
#/usr/bin/ndd -set /dev/tcp tcp_largest_anon_port 61000
For UDP connections we use:
#/usr/bin/ndd -set /dev/udp udp_smallest_anon_port 15000
#/usr/bin/ndd -set /dev/udp udp_largest_anon_port 61000
To make the change persistent after reboot we can append the following entries in /etc/rc.config.d/nddconf:

Linux ephemeral port range for TCP/UDP connections over IPv4

The range of ephemeral ports a client program can use (unless otherwise specified by the program) on modern Linux OS distributions by default is from 32768 till 61000 (for systems with more than 128 MB RAM) and from 1024 till 4999 (or even less) for systems with less than 128MB of RAM. This range is defined in the kernel parameter /proc/sys/net/ipv4/ip_local_port_range and it affects both TCP as well as UDP client connections.
Should there will be a need to change this range to extend the range(for example setting the lowest port number to 15000) we cal use:
echo "15000 61000" > /proc/sys/net/ipv4/ip_local_port_range

To make this change persistent after reboots, we can use sysctl.

Cisco CSS 11500 series internal services

By default the Cisco CSS 11501 series loadbalancers will create an implicit internal service to check the availability of the gateways for its static defined routes.
This internal service monitors the availability of the route which goes through a specific gateway by sending ICMP keepalives to that gateway. In that way if the internal service is in "Alive" state, the route for which the internal service is running is maintained in the routing table, otherwise if the service is in "Down" state then the route is withdrawn from the routing table (if there are no valid arp entries cached for that gateway).
The checking of the service availability is implemented through ICMP keepalives (ping) which are sent to the gateway of the destination defined in the static route.

These services are visible from the debug mode of the CSS. To have a look how they are defined and at which interval the keepalives are sent you can use:

CSS11501# llama

which gets you to debug mode

Resizing extended partitions with GNU parted

This post will show how to resize an extended partition using GNU parted. There are many tools for partitioning available, but I wanted to use a tool which was by default installed in my test system (which runs CentOS Linux).

In summary "The GNU Parted program allows you to create, destroy, resize, move,and copy hard disk partitions. Parted can be used for creating space for new operating systems, reorganizing disk usage, and copying data to new hard disks."

On my test CentOS system I had three primary extended partitions created and one extended as below:
Model: ATA ST3500320AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 535MB 535MB primary ext3 boot
2 535MB 11.0GB 10.5GB primary ext3
3 11.0GB 12.1GB 1078MB primary linux-swap
4 12.1GB 37.1GB 25.0GB extended
5 12.1GB 37.1GB 25.0GB logical lvm
As it's visible I had plenty of space on my hard drive (500GB), but I could use only approximately 7% (as I had 3 primary partitions and one extended there's no way in which I could create another partition).