Objective: Follow the path your development server's traffic takes to reach the internet. Tell your local area network (LAN) from the wide area network (WAN) with
ip route,ping,curlandtraceroute, then look at real network activity withss.
In Lab 9 you looked inside your development server: its interfaces, its IP address, its default gateway and its DNS server. You made the address static, and everything stayed on one server. Since Lab 7 you have also reached your production server, which is somewhere on the UW network, and in Lab 10 you pushed files to GitLab, somewhere on the internet.
In this lab you look at how your traffic gets there. You find out which addresses are on your own network, and which ones need a router. You find the address the rest of the internet sees for you, and trace each router between your server and production. Then you look at the connections open on your server right now.
Note: This lab is done on your development server, NOT your production server. Connect with SSH from Terminal or PuTTY and log in as your own user. A few steps also run a command on your laptop, and Part 6 opens a second SSH session.
Tip: Nothing in this lab changes your network settings. Every command only looks. If something stops working, it wasn't caused by this lab, so check the Troubleshooting section.
Some steps give you every command. Others give you a Goal and ask you to work out the commands yourself. If you get stuck, open the hint. Once you have an answer, or if you are really stuck, open the solution and compare it with your own.
If you get stuck, check the Troubleshooting section at the end of this lab.
These are the values you wrote down in Lab 9, Part 5, plus a few more that matter in this lab. Always use your values, not the examples.
| Setting | UTM (Mac) | VirtualBox (Windows) |
|---|---|---|
| Interface name | enp0s1 | enp0s3 |
| IP address | 192.168.64.x/24 | 10.0.2.15/24 |
| Default gateway | 192.168.64.1, your Mac | 10.0.2.2, VirtualBox |
| DNS server | 192.168.64.1 | 10.0.2.3 |
| Your SSH session comes from | 192.168.64.1 | 10.0.2.2, because of the port forward from Lab 1 |
traceroute |
Usually shows every hop | Often hides the hops. See Part 5 |
The examples and screenshots in this lab come from a UTM server, so they use enp0s1 and 192.168.64.7. Public addresses in the examples, such as 203.0.113.45, are made up. Yours are different.
A LAN (local area network) is a network in one place, such as your home, an office or a classroom. Devices on a LAN can reach each other directly. A WAN (wide area network) joins LANs together over long distances. The internet is the biggest WAN of all.
Your development server is further from the internet than you might think. Its traffic crosses three networks:
| Network | Who is on it | Who is its gateway |
|---|---|---|
| The virtual network | Your development server and your hypervisor | UTM (your Mac) or VirtualBox |
| Your home LAN | Your laptop, phone, TV, and anything else on your Wi-Fi | Your home router |
| The internet (WAN) | Your internet provider, UW, Google, and everyone else | Many routers, one after another |
Each gateway is a router: a device that joins two networks and passes traffic between them. This diagram shows the path. The numbered questions are what you answer in Parts 1 to 5:

Note: If you are on campus, your laptop is on the UW network, not a home LAN. The idea is the same. Your traffic still goes through your hypervisor, then the network your laptop is on, then the internet.
Some ranges of IPv4 addresses are set aside as private. Anyone can use them inside their own LAN, but routers on the internet never pass them on. That is why every UTM server in the class can have an address that starts with 192.168.64, and every VirtualBox server can be 10.0.2.15, without getting in each other's way.
| Private range | Prefix | You may have seen it |
|---|---|---|
| 10.0.0.0 to 10.255.255.255 | /8 |
VirtualBox, 10.0.2.15 |
| 172.16.0.0 to 172.31.255.255 | /12 |
Some offices and cloud providers |
| 192.168.0.0 to 192.168.255.255 | /16 |
UTM, 192.168.64.x, and most home routers |
Any address outside these ranges (and outside 127.x.x.x, the loopback range from Lab 9) is a public address. Public addresses are unique across the whole internet.
Your development server's address is the first point on the diagram. Find it again, as in Lab 9:
ip -br address
lo UNKNOWN 127.0.0.1/8 ::1/128
enp0s1 UP 192.168.64.7/24 fe80::...
192.168.64.7 starts with 192.168, so it is private.
Your laptop sits between your development server and your home router. It has an address on your home LAN.
Goal: On your laptop, not your development server, find your laptop's IPv4 address and its default gateway. Is the address private? Is it on the same network as your development server?
pscp in Lab 8. The Windows command has a name very close to the Linux ip command, and its output has a section for your Wi-Fi adapter.ipconfig command, with a getifaddr option. Your Wi-Fi interface is usually en0.Windows, in Command Prompt:
ipconfig
Look under Wireless LAN adapter Wi-Fi (or Ethernet adapter, if you use a cable) for IPv4 Address and Default Gateway:
Wireless LAN adapter Wi-Fi:
IPv4 Address. . . . . . . . . . . : 192.168.1.23
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
Mac, in Terminal:
ipconfig getifaddr en0
route -n get default | grep gateway
192.168.1.23
gateway: 192.168.1.1
If ipconfig getifaddr en0 prints nothing, try en1. You can also find both values in System Settings, Wi-Fi, Details.
In this example the laptop is 192.168.1.23/24, and the home router is 192.168.1.1. The address is private. It is not on the same network as the development server: 192.168.1 is not 192.168.64 (UTM), or 10.0.2 (VirtualBox). Your laptop is on the home LAN, and your development server is on its own virtual network inside your laptop.
Many home routers use 192.168.0.x or 192.168.1.x, and some use 10.x.x.x. Write down yours.
You should now have two of the networks written down, something like this:
| Network | Example address | Example gateway | Yours |
|---|---|---|---|
| Virtual network | 192.168.64.7/24 | 192.168.64.1 | |
| Home LAN | 192.168.1.23/24 | 192.168.1.1 |
Every time your server sends a packet, it makes one decision: is the address on my network, so I can deliver it myself? Or is it somewhere else, so I hand it to my default gateway? The routing table holds the answer.
In Lab 9 you found your gateway on the default line of ip route. Look at the whole table now:
ip route
default via 192.168.64.1 dev enp0s1 proto static metric 100
192.168.64.0/24 dev enp0s1 proto kernel scope link src 192.168.64.7 metric 100
| You see | It means |
|---|---|
192.168.64.0/24 dev enp0s1 |
The local network. Every address from 192.168.64.1 to 192.168.64.254 is reached directly through enp0s1. |
proto kernel scope link |
Linux added this route itself, as soon as the interface got its address. link means "on the same network as me". |
src 192.168.64.7 |
The address your server sends from, on this network. |
default via 192.168.64.1 |
For every other address, send the packet to the gateway, and let it work out the rest. |
proto static |
You set this route yourself, with nmcli in Lab 9. Before that it said proto dhcp. |
The /24 from Lab 9 decides where your network ends. With /24, the first three numbers name the network, and the last number names the host.
ip route get shows the decision your server makes for one address, without sending anything. Try your gateway, then an address on the internet. 8.8.4.4 is one of Google's DNS servers:
ip route get 192.168.64.1
ip route get 8.8.4.4
192.168.64.1 dev enp0s1 src 192.168.64.7 uid 1000
cache
8.8.4.4 via 192.168.64.1 dev enp0s1 src 192.168.64.7 uid 1000
cache
| Line | It means |
|---|---|
192.168.64.1 dev enp0s1 |
No via. The gateway is on your LAN, so your server delivers to it directly. |
8.8.4.4 via 192.168.64.1 dev enp0s1 |
via a router. 8.8.4.4 is not on your LAN, so the packet goes to your gateway first. |
Use your own gateway in place of 192.168.64.1. VirtualBox users use 10.0.2.2.
To deliver a packet directly, on the same LAN, your server needs the other device's MAC address, the hardware address you saw with ip address show in Lab 9. It finds it with a protocol called ARP, and keeps a list of the neighbors it has found:
ip neighbor
192.168.64.1 dev enp0s1 lladdr 3e:22:fb:a1:5c:64 REACHABLE
There is only one neighbor: your gateway. Notice what is not in the list: Google, your production server, GitLab. Your server never learns their MAC addresses. It sends everything for them to the gateway's MAC address, and the gateway passes it on. Your server only ever talks directly to devices on its own LAN.
Note:
REACHABLEmeans your server heard from the neighbor recently.STALEis normal too. It means it is time to check again the next time it sends a packet there.
Goal: For each address below, predict whether your server delivers it directly or via the gateway. Then check each one with ip route get.
| UTM | VirtualBox |
|---|---|
| 192.168.64.200 | 10.0.2.200 |
| 192.168.65.1 | 10.0.3.1 |
| 1.1.1.1 | 1.1.1.1 |
| Your laptop's address from Task 1 | Your laptop's address from Task 1 |
/24 line of ip route?ip route get works for any address, even one that no device is using. It only asks the routing table.ip route get 192.168.64.200
ip route get 192.168.65.1
ip route get 1.1.1.1
ip route get 192.168.1.23
VirtualBox users use 10.0.2.200 and 10.0.3.1 in the first two.
| Address | Direct or via? | Why |
|---|---|---|
| 192.168.64.200 | Direct | Same first three numbers as your network, 192.168.64. |
| 192.168.65.1 | Via gateway | One number different is a different network. |
| 1.1.1.1 | Via gateway | A public address on the internet (Cloudflare's DNS server). |
| Your laptop, 192.168.1.23 | Via gateway | Your laptop's home LAN is a different network from your virtual network. |
The last one surprises many people. Your laptop is the machine your server is running on, but your server still sends to its home LAN address through the gateway. On UTM, the gateway is your Mac, using a different address on the virtual network.
ip route get tells you where a packet would go. ping checks that it actually gets there and back. It sends a small ICMP echo request packet, and the other end sends back an echo reply. ICMP is the protocol routers and servers use to report on the network itself.
Start with the first router on the path. -c 3 sends three pings, then stops:
ping -c 3 192.168.64.1
Use your own gateway. VirtualBox users use 10.0.2.2.
PING 192.168.64.1 (192.168.64.1) 56(84) bytes of data.
64 bytes from 192.168.64.1: icmp_seq=1 ttl=64 time=0.412 ms
64 bytes from 192.168.64.1: icmp_seq=2 ttl=64 time=0.351 ms
64 bytes from 192.168.64.1: icmp_seq=3 ttl=64 time=0.443 ms
--- 192.168.64.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2034ms
rtt min/avg/max/mdev = 0.351/0.402/0.443/0.038 ms
| You see | It means |
|---|---|
64 bytes from ... |
A reply came back. Each line is one reply. |
icmp_seq=1 |
The number of the ping. A missing number is a lost packet. |
ttl=64 |
Time to live. Each router a packet crosses takes 1 off this number. You will use it in Part 5. |
time=0.412 ms |
The round trip time: how long the ping took to get there and back, in milliseconds (thousandths of a second). |
0% packet loss |
Every ping got a reply. |
rtt min/avg/max |
The fastest, average and slowest round trip. |
Less than a millisecond. The gateway is on the same LAN, inside the same laptop.
Common Pitfall: Without
-c, Linuxpingnever stops. Press Ctrl+C, as in Lab 2, to stop it and see the statistics.
Goal: Ping three more places, three times each: Google's DNS server 8.8.8.8, a name, pce.uw.edu, and your production server. Compare the average round trip times with your gateway's. What do the times tell you about LAN and WAN?
ping -c 3 command, with a different address or name at the end.ping accepts names as well as addresses. It looks the name up first, with the DNS server from Lab 9.ping -c 3 8.8.8.8
ping -c 3 pce.uw.edu
ping -c 3 ulc-###.ulcert.uw.edu
Replace ### with your production server's number. Your times depend on where you are, and on your internet provider. They may look something like this:
| Destination | Network | Example average |
|---|---|---|
| Your gateway | Virtual LAN | 0.4 ms |
| 8.8.8.8 | Internet (WAN) | 15 ms |
| pce.uw.edu | Internet (WAN) | 12 ms |
| ulc-###.ulcert.uw.edu | Internet, then the UW network | 20 ms |
The LAN is ten to a hundred times faster than the WAN. On a LAN the packet crosses one short link. On the WAN it crosses many routers, and many miles of cable, there and back.
ping pce.uw.edu prints the name's IP address on its first line, in brackets. That is the address DNS gave back. You will look at DNS in more detail in Lab 13.
Your production server answers too. The class servers are set up to allow ping, so you can always use it to check that yours is up. Not every server is that friendly, as the next section shows.
Not every server answers ping. Try the main UW web site:
ping -c 3 www.washington.edu
PING www.washington.edu (198.51.100.80) 56(84) bytes of data.
--- www.washington.edu ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2051ms
| You see | It means |
|---|---|
PING www.washington.edu (198.51.100.80) |
DNS worked. Your server turned the name into an address. |
No 64 bytes from lines |
Your pings went out, but no replies came back. |
100% packet loss |
Every ping was lost. |
ping waits a few seconds for each reply, so this takes longer than the others. Is the web site down? Ask it for a web page instead, with curl from Part 4. -I asks for the page's headers only, the short summary at the top, not the whole page:
curl -I https://www.washington.edu
HTTP/2 200
last-modified: Mon, 19 Oct 2026 16:13:51 GMT
content-type: text/html
server: Apache
...
The first line starts with HTTP, and 200 means OK: the web server answered, and sent the page. Any answer at all means the server is up.
Note: Why not www.uw.edu? Try
curl -I https://www.uw.edu. It answers HTTP/2 302, with a location: line pointing to https://www.washington.edu/. A 302 is a redirect: the web server tells your browser to fetch the page from somewhere else, and the browser follows it without asking you. DNS isn't involved. The name resolved fine, and the web server chose to send you on. You will see web servers and their answers in Lab 13.
So the server is up, and your server can reach it, but it doesn't answer ping. The UW network filters ICMP echo requests on their way to the web server. A firewall passes some kinds of traffic and drops others. Here it passes web traffic, on TCP port 443, and drops ping. You will see ports in Part 6, and set up a firewall of your own in Lab 14.
Question: Why would an organization block
pingto its servers?
To make its servers harder to find and to attack. An attacker can ping every address in a range to see which ones are in use, and can flood a server with pings. Blocking ping hides the server from that kind of scan, but it doesn't make the server safe on its own. The web server still answers on port 443, because that is its job. Many organizations leave ping on for their own network staff, and block it from the internet.
Tip: When "the network is down", ping your way out from the server, one step at a time: the gateway, then an internet address such as 8.8.8.8, then a name that answers ping, such as pce.uw.edu. The first one that fails tells you where to look. If the address works but the name doesn't, the problem is DNS, not the network. And if ping gets no reply, check with something the server is meant to answer, such as
curlfor a web server, before you decide it is down.
Your development server's address is private. So is your laptop's. Routers on the internet won't pass private addresses on. So how do replies from Google find their way back to you?
Each gateway uses NAT (network address translation). When a packet leaves your home, your home router swaps the private from address for its own public address, and remembers that it did. When the reply comes back, it swaps the address back and passes the reply in to the device that asked. Your hypervisor does the same thing for your development server, one level further in. Every device in your home shares one public address.
You can't find your public address on your own server. It is on the outside of your home router. Ask a server on the internet what address it sees your request coming from:
curl -4 ifconfig.io
203.0.113.45
| Part | What it does |
|---|---|
curl |
Fetches a web page and prints it. You will use it again in Lab 13. |
-4 |
Use IPv4 only. Without it, you may get your IPv6 address instead. |
ifconfig.io |
A public web service that replies with the address your request came from, and nothing else. |
This is the third point on the diagram. Write it down. It is not in any of the private ranges from Part 1.
Question: Open https://ifconfig.io in a web browser on your laptop, or on your phone while it is on your home Wi-Fi. What address does it show? Why?
The same address as your development server. Your laptop, your phone and your development server all reach the internet through the same home router, and NAT gives them all the same public address. The web server can't tell them apart. If your phone is on mobile data instead of Wi-Fi, it shows a different address: your mobile provider's.
ping tells you whether you got there. traceroute shows each router on the way.
It uses the TTL you saw with ping in Part 3. Each router takes 1 off a packet's TTL, and a router that takes it to 0 drops the packet and sends back a "time exceeded" message. traceroute sends packets with a TTL of 1, then 2, then 3, and so on. The first router drops the first packet and replies, the second router drops the second packet, and each reply shows you one more hop along the path.
traceroute is not part of a Minimal Install:
sudo dnf install -y traceroute
Trace the path to your public address from Part 4. It is short, because your home router owns that address:
traceroute 203.0.113.45
traceroute to 203.0.113.45 (203.0.113.45), 30 hops max, 60 byte packets
1 _gateway (192.168.64.1) 0.521 ms 0.430 ms 0.401 ms
2 203.0.113.45 (203.0.113.45) 3.874 ms 3.802 ms 3.765 ms
| You see | It means |
|---|---|
30 hops max |
traceroute gives up after 30 routers. |
1 _gateway (192.168.64.1) |
Hop 1: your hypervisor's gateway, the edge of your virtual network. _gateway is a name RHEL gives your default gateway. You may see the address twice instead. |
2 203.0.113.45 |
Hop 2: your home router, answering on its public address. It is the destination, so the trace stops. |
0.521 ms 0.430 ms 0.401 ms |
traceroute sends three packets to each hop, and shows the round trip time of each one. |
This is the fourth point on the diagram: the route to the outside. Hop 1 is the virtual network, and hop 2 is the home router. From there, the next hop would be your internet provider: the WAN.
Note: Your trace may look a little different. Some home routers show their private address, such as 192.168.1.1, as an extra hop, and some don't answer
tracerouteat all, so the last hop shows* * *. Each*is a packet that got no reply in time.
Note: VirtualBox users: the VirtualBox NAT often hides the path. You may see
* * *on every line, or the destination as hop 1. Trysudo traceroute -Iwith the same address.-Iuses ICMP, likeping, and needssudo. If that doesn't help either, run the trace from your Windows laptop instead, in Command Prompt, withtracert. You see the same path, minus the first hop.
Goal: Trace the path from your development server to your production server. Mark where your LAN ends and the WAN begins. About how many routers does your traffic cross?
traceroute takes a name as well as an address.* * * lines at the end is normal. Press Ctrl+C if you don't want to wait for all 30 hops.traceroute ulc-###.ulcert.uw.edu
Replace ### with your server's number. Your path is different, but it may look something like this:
traceroute to ulc-###.ulcert.uw.edu (198.51.100.20), 30 hops max, 60 byte packets
1 _gateway (192.168.64.1) 0.512 ms 0.442 ms 0.409 ms
2 192.168.1.1 (192.168.1.1) 3.911 ms 3.850 ms 3.799 ms
3 10.20.0.1 (10.20.0.1) 12.104 ms 11.987 ms 11.902 ms
4 ... 14.310 ms 14.276 ms 14.233 ms
...
11 * * *
12 * * *
| Hops | Where | Network |
|---|---|---|
| 1 | Your hypervisor, 192.168.64.1 | Virtual LAN |
| 2 | Your home router, 192.168.1.1 | Home LAN |
| 3 and on | Your internet provider, then other networks, then UW | WAN |
| Last | Your production server, or * * * |
UW network |
The jump in time between hop 2 and hop 3 is where your traffic leaves your home. That is the edge between your LAN and the WAN. Hop 3 may have a private address too: many internet providers use private addresses inside their own network.
Most traces to production cross somewhere between 8 and 15 routers. You may see names ending in washington.edu near the end. Those routers belong to the UW network.
If the last few lines are * * *, a router near the end of the path doesn't answer traceroute. Your server is still up: it answered ping in Task 3.
Going further: traceroute looks up a name for every hop, which can be slow. traceroute -n shows addresses only, and finishes much faster. Run the same trace from your laptop too, with tracert on Windows or traceroute on the Mac. It is the same path, without hop 1.
Networking is built in layers. Each layer does one job, and relies on the layer below it. Two models describe the layers. The OSI model has seven, and the TCP/IP model, which the internet is actually built on, has four. You have already used a tool at almost every layer:
| OSI layer | TCP/IP layer | What it does | What you have used |
|---|---|---|---|
| 7 Application | Application | The program's own messages | ssh, curl, git, dnf, DNS |
| 6 Presentation | Application | Data format and encryption | The SSH encryption from Lab 7 |
| 5 Session | Application | Keeping a conversation going | Your SSH session |
| 4 Transport | Transport | Ports, and reliable delivery with TCP or fast delivery with UDP | ss, in this part |
| 3 Network | Internet | IP addresses and routing between networks | ip address, ip route, ping, traceroute |
| 2 Data link | Link | MAC addresses, delivery on one LAN | ip link, ip neigh |
| 1 Physical | Link | The cable, Wi-Fi or virtual card | ethtool, from Lab 9 |
When you troubleshoot, work up from the bottom. There is no point checking a web server (layer 7) if the interface is down (layer 1), or the gateway doesn't answer ping (layer 3).
An IP address gets a packet to the right server. A port gets it to the right program on that server. A port is a number from 1 to 65535. Common services use well known ports, such as 22 for SSH, 53 for DNS and 80 for web pages.
| Protocol | How it works | Used by |
|---|---|---|
| TCP | Sets up a connection first, and makes sure every piece arrives, in order. Reliable. | SSH, web pages, Git |
| UDP | Just sends each packet, with no connection and no checks. Fast. | DNS, video calls, time sync |
Linux keeps a list of well known ports in /etc/services:
grep -w 22 /etc/services
ssh 22/tcp # The Secure Shell (SSH) Protocol
ssh 22/udp # The Secure Shell (SSH) Protocol
ssh 22/sctp # SSH
c1222-acse 1153/tcp # ANSI C12.22 Port
c1222-acse 1153/udp # ANSI C12.22 Port
Each line is a service name, then its port and protocol, then a # comment.
-w tells grep to match whole words only. Without it, grep 22 would also match 1022, 2222 and any other number with 22 in it. A word is a run of letters, numbers and _. Anything else, such as a space, a / or a ., marks the edge of a word. So 22 in 22/tcp is a word, and so is the 22 at the end of C12.22, because the . comes before it.
| Line | What it is |
|---|---|
22/tcp |
SSH on TCP. This is the one your SSH connections use. |
22/udp |
SSH on UDP. The port is reserved for SSH, but SSH doesn't use it. |
22/sctp |
SSH on SCTP (Stream Control Transmission Protocol), a third transport protocol, alongside TCP and UDP. It is used mostly inside phone networks. You won't use it in this course. |
c1222-acse |
Port 1153, used by ANSI C12.22, a standard for smart electricity meters to report over a network. It only matched because the comment says C12.22. |
To see only the line you want, include the protocol: grep -w 22/tcp /etc/services. You can search the other way too. grep -w ssh /etc/services shows every port listed for ssh.
ss (socket statistics) lists the network connections on your server. Start with the programs that are listening, waiting for someone to connect:
ss -tln
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 [::]:22 [::]:*
| Option | What it does |
|---|---|
-t |
TCP only. -u shows UDP. |
-l |
Listening only. |
-n |
Show numbers, such as 22, instead of names, such as ssh. |
| You see | It means |
|---|---|
0.0.0.0:22 |
Listening on port 22, on every IPv4 address the server has. |
[::]:22 |
The same, for IPv6. |
0.0.0.0:* |
Anyone, from any port, may connect. |
Only one program is listening, on port 22: the SSH server you hardened in Lab 7. You may see one or two more, depending on what you have installed. To see the program's name, ask with sudo:
sudo ss -tlnp
The Process column now shows users:(("sshd",pid=...)). -p shows the process, and only root may see other users' processes.
Now look for connections that are established, open right now:
ss -tn
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
ESTAB 0 52 192.168.64.7:22 192.168.64.1:53412
| Column | Example | It means |
|---|---|---|
| State | ESTAB |
Established: an open TCP connection. |
| Local Address:Port | 192.168.64.7:22 |
Your server's end: its address, and the SSH port. |
| Peer Address:Port | 192.168.64.1:53412 |
The other end. 53412 is a random port the SSH client picked on your laptop. |
That is your SSH session. On UTM the peer is your Mac's address on the virtual network. On VirtualBox it is 10.0.2.2: your connection comes in through the port forward from Lab 1, so to your server it looks as if VirtualBox connected.
SSH also tells your shell where the session came from:
echo $SSH_CONNECTION
192.168.64.1 53412 192.168.64.7 22
The client's address and port, then the server's address and port. They match the ss line.
Goal: Open a second SSH session to your development server. In it, start an agent, and SSH from development to your production server, as in Lab 7, Part 6. Leave it logged in. Back in your first session, use ss to find the connection to production. Which port does it use at each end?
eval and ssh-add, from Lab 7.ss -tn lists every established connection. You have more than one now. Which one has a peer port of 22?ping printed your production server's IP address in Part 3, Task 3.In the second session:
eval "$(ssh-agent -s)"
ssh-add
ssh username@ulc-###.ulcert.uw.edu
Replace username and ### with your production username and server number.
In the first session:
ss -tn
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
ESTAB 0 0 192.168.64.7:22 192.168.64.1:53412
ESTAB 0 0 192.168.64.7:22 192.168.64.1:53498
ESTAB 0 0 192.168.64.7:41736 198.51.100.20:22
| Line | It is |
|---|---|
192.168.64.7:22 to 192.168.64.1:53412 |
Your first session, from your laptop. Your server is the server end, on port 22. |
192.168.64.7:22 to 192.168.64.1:53498 |
Your second session, from your laptop. |
192.168.64.7:41736 to 198.51.100.20:22 |
The connection to production. This time your server is the client. It picked a random local port, 41736, and connected to port 22 on production. |
Notice that the local address is still your private address. ss shows the connection as your server sees it, before NAT. Production sees it coming from your public address from Part 4. Log in to production, and run echo $SSH_CONNECTION there to see it.
To show only connections to port 22 on another server, ss has a filter:
ss -tn dst :22
When you are done, type exit on production, then stop the agent in the second session with eval "$(ssh-agent -k)", as in Lab 7, and close the second session with exit.
Tip: Want to see the packets inside these connections? The bonus lab Watching packets with tcpdump picks up from here.
You have now:
ip route get and ip neigh to see which addresses your server reaches directly, and which go through the gateway.ping to test the path, and compared round trip times on the LAN and the WAN.curl -4 ifconfig.io, and seen how NAT lets every device in your home share it.traceroute, and found where your LAN ends.ss.Discuss these with others in class:
via for your laptop's home address, even though your server is running on that laptop?ping, but curl gets a web page from it. How can both be true? What would you check before telling someone a server is down?ss showed your private address for the connection to production. What address did production see? Which device changed it?ping to 8.8.8.8 works, but ping pce.uw.edu says Name or service not known. Which layer is the problem at? Where would you look first?Q. My interface isn't called enp0s1.
A. That is fine. Run ip -br address and use the name of the interface that isn't lo everywhere you see enp0s1. VirtualBox usually uses enp0s3.
Q. ping doesn't stop.
A. Press Ctrl+C. Use -c 3 to send three pings and stop by itself.
Q. ping 8.8.8.8 works, but ping pce.uw.edu and curl say "Name or service not known" or "Could not resolve host".
A. The network is fine, but DNS isn't. Check the nameserver lines in /etc/resolv.conf, and the ipv4.dns setting with nmcli -g ipv4.dns connection show enp0s1. If you made a typo in Lab 9, Part 7, fix it as you did there, or put your backup keyfile back, as in Lab 9, Undoing this change.
Q. ping to a server shows "100% packet loss", but its web site works.
A. The server, or a firewall in front of it, ignores ping. www.washington.edu does this on purpose. See When ping gets no answer. Check with curl -I for a web server, or ssh for your production server, before you decide it is down.
Q. ping to my gateway fails.
A. Your server can't reach its own LAN. Check ip -br address for UP and the right address, and ip route for the default line. Compare them with the settings you wrote down in Lab 9, Part 5. If you are connected with SSH, your gateway must be answering something, so check that you typed the right address.
Q. curl ifconfig.io prints a long address with colons in it.
A. That is your public IPv6 address. Add -4: curl -4 ifconfig.io.
Q. traceroute says "command not found".
A. Install it with sudo dnf install -y traceroute.
Q. traceroute shows * * * on every line.
A. Something on the path doesn't answer traceroute. This is common on VirtualBox, and on some home and campus networks. Try sudo traceroute -I with the same address. If that doesn't help, run the trace from your laptop: tracert in Command Prompt on Windows, or traceroute in Terminal on the Mac.
Q. traceroute is very slow.
A. It looks up a name for every hop, and waits for hops that never answer. Add -n to skip the names, or press Ctrl+C once you have seen enough.
Q. ss -tln shows more than port 22.
A. That is fine. Each line is another program listening. Run sudo ss -tlnp to see its name. If you installed the web console, cockpit, you may see port 9090.
Q. ssh to production asks for a password, or says "Permission denied (publickey)".
A. Your agent isn't running in this session, or your key isn't loaded. Run eval "$(ssh-agent -s)" and ssh-add, then try again. See the Lab 7 troubleshooting section for more.
If you can't solve a problem, post it in this week's Teams channel, or reach out by email for help.
Lab complete