USD ($)
$
United States Dollar
India Rupee

Establish Device Reachability

Lesson 18/17 | Study Time: 60 Min
Establish Device Reachability

Scenario Context: It's your first day. You've been given a console access of the management station. Your first task is to log into the Ubuntu-MGMT, confirm its network connection, and discover what devices are alive on the local network segment. The network itself is unconfigured, so you're starting from scratch. 


Task List:

● Get the console access to the Ubuntu-MGMT.

 Establish an SSH connection to the Linux server.

 Understand your current directory and perform basic navigation.

 Identify the IP address assigned to your server's Ethernet interface.

 Discover the DHCP server (the Internet-router) using basic network discovery commands.


Detailed Step-by-Step Walkthrough:

Alright, let's get started. The first thing you need to do is access your primary tool, the Ubuntu-MGMT station. Let's connect to its console, click on Ubuntu-MGMT, its console opens in next tab. It's a GUI, login to it using username "user" and password "Test123". Once logged in, right click on the desktop and click on "open a terminal" and you type:

ip address show


user@user-pc:~/Desktop$ ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:50:00:00:07:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.4/24 brd 192.168.123.255 scope global dynamic noprefixroute ens3
       valid_lft 85964sec preferred_lft 85964sec
    inet6 fe80::28c2:3def:9b64:fbc/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever


As you can see in the above output, the IP address on it's interface is 192.168.123.4/24. Similarly take the console access of the Linux server, click on it, it's console will open on next tab. Login (CLI) using username "root" and password "root" then type the command. Once logged into the Linux server, type the command.

ip address show

Here it's show on Linux's eth0 is receiving an IP address 192.168.123.2/24 (It may be different in your case)

Now On Ubuntu-MGMT station, let's open a terminal we'll connect Linux server using the Secure Shell protocol, SSH. The command is simple: ssh, followed by the username, the @ symbol, and then the IP address or hostname. Our credentials were provided as root for both username and password.

ssh root@192.168.123.2

Of course, the actual last octet we show on Linux's eth0 (in our case .2). You press Enter.

Since this is likely the first time connecting to this server, your SSH client will show a message about the authenticity of the host. It's asking, "Do you trust this new server you've never connected to before?" It's a security feature. You type yes and press Enter.

Now it prompts for the password. You type root and press Enter. Remember, when you type the password, the cursor won't move or show asterisks—that's normal for SSH. Just type it carefully and press Enter.

Perfect. You're in Linux server now. The command prompt has changed. It now says something like root@kvm:~#. This is your first piece of information. The part before the @ tells you the user you're logged in as (root). The part after the @ is the hostname of the server (kvm). The ~ is a symbol, and it's very important. That tilde (~) is a shortcut. It represents your home directory. In this case, /root/. The # at the end is the prompt itself, and it confirms you have superuser, or root, privileges. A $ would indicate a regular user.

Now, let's get our bearings. Where exactly are we in the filesystem? You use the command pwd, which stands for "Print Working Directory."

pwd

You press Enter, and it prints /root. That confirms it. You are in the home directory for the root user. Good. What's in here? Let's list the contents. Use the ls command.

ls -la

Here, ls is the list command. The -l tells it to use a long listing format, which gives us details like permissions and file size. The -a tells it to show all files, including hidden ones. Hidden files in Linux start with a dot (.), like .bashrc. You press Enter.

You'll see a few files and directories. Things like .bashrc, .profile. These are configuration files for your shell session. We'll look at those later. For now, just note that the directory isn't empty, but there are no network device configs here yet. We'll need to create a place for those.

Our first real network task is to answer: "What is my server's IP address?" You know it's connected to the switch on interface eth0, but you need the actual assigned IP. The classic command ifconfig is often used, but on modern Ubuntu, the preferred tool is the ip command from the iproute2 suite. It's more powerful. Let's use it to show all addresses.

Type:

ip addr show

You can shorten this to ip a. Let's do that:

ip a

Press Enter.

You'll see a list of network interfaces. The first one, lo, is the loopback interface. It's for local communication on the server itself. Its IP is always 127.0.0.1. We're interested in eth0, the Ethernet interface connected to the switch. Look for a section that starts with 2: eth0:.

Under that section, look for the line that starts with inet. It will look something like:

inet 192.168.123.2/24 brd 192.168.123.255 scope global eth0

There it is. Your server's IP address is 192.168.123.2. The /24 is the subnet mask, meaning the network is 192.168.123.0. The brd is the broadcast address. This is your most critical piece of information—your management IP. Write it down. This is how the network devices will eventually reach you for management.

We know from the topology that the Internet-Router is acting as the DHCP server for this 192.168.123.0/24 network. That means it gave this IP to our server. Let's verify we can reach it. We'll use the most fundamental network troubleshooting tool: ping.

You ping by sending a small packet to a target and asking for a reply. The syntax is ping followed by the IP address. Let's try to ping the router. We don't know its exact IP, but we can make a very educated guess. In a simple /24 network like this, the first usable address is often the gateway or server. Let's try .1.

Type:

ping -c 4 192.168.123.1

The -c 4 means "send only 4 packets." If we just typed ping 192.168.123.1, it would ping forever until you stop it with Ctrl+C. We want a quick test. Press Enter.

Look at the output. You should see lines like:

64 bytes from 192.168.123.1: icmp_seq=1 ttl=255 time=0.8 ms

Success! You got replies. The time is the round-trip latency in milliseconds. This confirms two things: First, your server has a valid network path to the router. Second, 192.168.123.1 is indeed a live device. Given the topology, this must be the Internet-Router's GigabitEthernet0/0 interface. Excellent discovery.

Now, let's see what other device might be on this network which are configured to receive an IP via DHCP. It should have an IP in this same range. How can we find it without trying to ping 254 possible addresses one by one? We can check the server's Address Resolution Protocol (ARP) table. ARP is how devices map IP addresses to MAC addresses on a local network. Your server has likely already talked to the router and maybe even seen traffic from the other devices.

Let's view the ARP cache.

arp -a

Press Enter.

You may see something like this: 

Command 'arp' not found, but can be installed with:

apt install net-tools

So that means you need to install net tool first using command.

apt install net-tools

Once installation is completed, you can run command arp -a again

This command lists the IP and MAC addresses of devices your server has recently communicated with on this network segment. You'll see an entry for 192.168.123.1. That's the Internet-Router. You might also see another entry, perhaps 192.168.123.11 (R1) , 192.168.12 (SW) and 192.168.123.4 (Ubuntu-MGMT) or similar. If the ARP table is empty except for the router, it just means we haven't seen any broadcast traffic from it yet.

For now, the critical takeaway is that you have confirmed your own IP, confirmed connectivity to the Internet-Router, and learned how to look for other hosts.

Let's do one final check. Look at the routing table on your Ubuntu server. This tells the server where to send traffic for different networks. The command is ip route or the older netstat -rn. Let's use ip route.

ip route show

Press Enter.

You'll see a line like:

default via 192.168.123.1 dev eth0

This is your default route. It says, "For any traffic not destined for my local network, send it to 192.168.123.1 (the router) out of interface eth0." You'll also see a line for your local network:

192.168.123.0/24 dev eth0 proto kernel scope link src 192.168.123.2

This says the local network is directly connected to eth0.

This is the foundation. You are logged in. You know your Linux server IP (192.168.123.2) - Remember in your case it may have different IP. You know your gateway (192.168.123.1). You have connectivity. You've used ip a, ping, arp, and ip route. These are your core discovery tools. In the next lab, we'll start creating configuration files for the network devices you've just discovered.

To log out of the server, you can type exit.

exit

Press Enter. You'll be returned to your Ubuntu-MGMT station terminal prompt.