How Do You Troubleshoot a Network Problem?

Note:  This posting should help you troubleshoot many different network problems (not just those described in the problem scenario below).  Possible solutions 1 through 5 are ideal for erratic nmap results (inconsistent or discrepant output). 

Problem scenario
A port seems blocked on a Linux server given the results of nmap. The host appears to be down. You know this port is not blocked by intermediate routers and/or firewalls. 

How Do You Troubleshoot the Docker Error “User specified IP address is supported on user defined networks only”?

Problem scenario
When using a “docker run” command you get this error: “Error response from daemon: User specified IP address is supported on user defined networks only.”  What do you do to create a user-defined network?

Solution
#1  From the Linux server (the Docker host), run this command:  ip addr show

#2  Look at the results for eth0. 

How Do You Find the IP Address Assigned to a Docker Container When It Was Created?

Problem scenario
You have inherited several Docker containers to manage.  They were assigned IP addresses and assigned user-defined networks when they were created.  You do not know what IP addresses that they were given.  You want to know the IP addresses so you can add them to a load balancer.  The external IP address of the Docker host combined with identifying port numbers of the containers can create sockets that are unique. 

How Do You Troubleshoot the Docker Error “User specified IP address is supported only when connecting to networks with user configured subnets.”?

Problem scenario
You are trying to create a Docker image and assign it an IP address with the –ip flag. But you get this error: “/usr/bin/docker-current: Error response from daemon: User specified IP address is supported only when connecting to networks with user configured subnets.”  How do you get your Docker command to work and resolve this problem?

Solution
#1  From the Linux server,

How Do You Change a Firewall Rule in Google Cloud Platform?

Problem scenario
You want to create an exception to your GCP firewall to allow connectivity from a different workstation or server.  What should you do?

Solution
1.  In the upper right hand corner of the console, click the icon with three horizontal bars.  This is the “Products and Services” button.  Then go to “VPC Network” -“Firewall Rules.”

2.  Click “Create Firewall Rule.”

3. 

Can SSH Work between a Linux Server and a Windows Client When the Window’s Machine Has Inbound Port 22 Traffic Blocked?

Question
Can SSH work between a Linux server and a Windows client when the Window’s machine has inbound port 22 traffic blocked?

Answer
Yes.  Some VPN tunnels initiated on a Windows machine block inbound port 22 traffic (but not all).  Regardless of whether a firewall or VPN tunnel prevents inbound connections over port 22 to a Windows machine, you can make establish an  SSH connection over port 22 from a Windows machine.  

What Is the Difference between the Internal IP Address of a Server and the External IP Address?

Problem scenario
You want to find the external and internal IP addresses of your servers.  You are not sure which is which.  

Solution
The internal IP address is found by issuing one of these commands on Linux:

ip addr show
ifconfig

For Windows, open a command prompt and run this command:

ipconfig

For Linux servers the external IP address is found by running this command (assuming your server has access to the internet):

curl http://icanhazip.com

For Windows open a web browser and go to http://ipchicken.com

If you are using AWS and your server does not have access to the internet,

How Do You Change the MAC Address of Your Wireless Network Adapter on a Windows 7 Machine?

Problem scenario
You want to change the MAC address of your wireless network adapter (e.g., you want a WiFi network to see your laptop as a different or new machine).  How do you do this?

Solution
1.  Go to Control Panel -Network and Internet

2.  Go to “Network and Sharing Center”

3.  Click on “Change adapter settings”

4.

Where Do You Find the IP Address from Most Recent Login on a Linux Server?

Problem scenario
You want to know where the Linux users are logging on from (e.g., for security and configuration reasons).  You want to know the IP addresses of their desktops.  Where do you find the IP address from most recent login on a Linux server?

Solution
To see the most recent login session details (including IP address), run this command:

last

After you press enter you’ll see the most recent logins.