Testing UDP port connectivity

There is no such thing as an “open” UDP port, at least not in the sense most people are used to think (which is answering something like “OK, I’ve accepted your connection”). UDP is session-less, so “a port” (read: the UDP protocol in the operating system IP stack) will never respond “success” on its own. … Read more

How to check the physical status of an ethernet port in Linux?

$ ethtool <eth?> For example: $ ethtool eth0 provides: Settings for eth0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 1 Transceiver: internal … Read more

How to get TX/RX bytes without ifconfig?

Another option is to use the /proc filesystem. The /proc/net/dev file contains statistics about the configured network interfaces. Each line is dedicated to one network interface and it contains statistics for receive and transmit. The statistics include metrics such total number of received/transmittted bytes, packets, drops, errors and so on. cat /proc/net/dev Inter-| Receive | … Read more

SSHFS mount that survives disconnect

Use -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 The combination ServerAliveInterval=15,ServerAliveCountMax=3 causes the I/O errors to pop out after one minute of network outage. This is important but largely undocumented. If ServerAliveInterval option is left at default (so without the alive check), processes which experience I/O hang seem to sleep indefinitely, even after the sshfs gets reconnect‘ed. I regard this … Read more

What is “anycast” and how is it helpful?

Anycast is networking technique where the same IP prefix is advertised from multiple locations. The network then decides which location to route a user request to, based on routing protocol costs and possibly the ‘health’ of the advertising servers. There are several benefits to anycast. First, in steady state, users of an anycast service (DNS … Read more

How do I make a connection private on Windows Server 2012 R2

Powershell. Here is an example of changing the network profile of a network interface called Ethernet1 from whatever it is now to “Private.” I got this info from Get-Help Set-NetConnectionProfile -Full. PS C:\>$Profile = Get-NetConnectionProfile -InterfaceAlias Ethernet1 PS C:\>$Profile.NetworkCategory = “Private” PS C:\>Set-NetConnectionProfile -InputObject $Profile Documentation: https://docs.microsoft.com/en-us/powershell/module/netconnection/set-netconnectionprofile?view=winserver2012r2-ps