Signal9Signal9 — home
online
back to labs

Where Am I on the Network?

EasyLinux Fundamentals10-15 min
The brief

Every time you land on a new Linux box, the first question is where it sits on the network: what its address is, where its traffic leaves for other networks, and which services are listening for connections. You're logged in as 'student' with no sudo, and you won't need it, because looking is free.

Save four answers in ~/answers/, one value per file:

1. ip.txt: this box's own IP address. 127.0.0.1 is loopback, the address every machine uses to talk to itself, so it doesn't count.

2. gateway.txt: the default gateway, the next hop for traffic going to any other network.

3. inventory.port: the port the inventory-api service listens on.

4. local-only.txt: the port of the one service that only accepts connections from this machine. A service bound to 0.0.0.0 listens on every interface, and one bound to 127.0.0.1 can only be reached from the box itself.

ip addr shows your addresses, ip route shows the routing table (the default line names the gateway), and ss -ltnp lists listening TCP sockets with their address, port and process. The same notes are in ~/brief.txt.

What you'll do
  • Read this box's own IP address with ip addr and tell it apart from loopback
  • Find the default gateway in the routing table with ip route
  • Use ss -ltnp to match listening ports to services and spot the loopback-only one

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.