Reading a machine's network settings
On this page
The command prints a block of six lines containing numbers and abbreviations. When a connection fails, you start by reading settings like these. First, find which interface each block describes and which line gives its address. You do not need to understand every number yet.
By the end, you can label those parts on a lab machine. You can also find where it sends messages for other networks.
Before you start
Section titled “Before you start”Finish Installing the lab. Have the lab running in its starting state. Begin in the Ubuntu terminal at the VM prompt, which names rootvolt.
Enter the machine before reading it
Section titled “Enter the machine before reading it”Run the commands in this replay. netlab shell laptop opens a shell on the lab machine. If it asks for a password, type your Ubuntu password as before.
learner@rootvolt:~$ netlab shell laptop[sudo] password for learner: learner@laptop:~$ ip address1: 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
4: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:77:10:00:00:10 brd ff:ff:ff:ff:ff:ff link-netns sw-home
inet 10.77.10.10/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::77:10ff:fe00:10/64 scope link
valid_lft forever preferred_lft foreverlearner@laptop:~$ Steps (9)
- Type
netlab shell laptop - Press Enter
- Output:
[sudo] password for learner: - Type the password (the terminal shows nothing)
- Press Enter
- The prompt names laptop. The following command reads this machine?s interfaces.
- Type
ip address - Press Enter
- Output:
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 4: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 02:77:10:00:00:10 brd ff:ff:ff:ff:ff:ff link-netns sw-home inet 10.77.10.10/24 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::77:10ff:fe00:10/64 scope link valid_lft forever preferred_lft forever
Check the word after @. It is laptop after entering the machine. The command ip address lists that machine’s interfaces. At the VM prompt, it would show the VM’s own settings instead.
An interface name tells a command which interface you mean. Read eth0 as a name, not an address. The output has one block per interface, starting with a number and a name. Read the lines below that heading as settings for that interface. The next numbered heading starts another interface’s block.
Read one interface block
Section titled “Read one interface block”Follow the eth0 block in the stage below. The first part gives the number and name. The next marked part gives the state. Then link/ether introduces a MAC address, inet introduces an IPv4 address, and inet6 introduces an IPv6 address.
The slash and number after an IP address are its prefix notation. For now, find that part of the line. The table shows where you will learn what it means. You do not need to calculate anything here.
Read laptop?s network interface
4: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:77:10:00:00:10 brd ff:ff:ff:ff:ff:ff link-netns sw-home
inet 10.77.10.10/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::77:10ff:fe00:10/64 scope link
valid_lft forever preferred_lft foreverstate UPlink/ether 02:77:10:00:00:10inet 10.77.10.10/24inet6 fe80::77:10ff:fe00:10/64Reading the output
Pick a step to match a marked part of the output to the picture.
Steps (5)
- Number and name. Number and name: 4: eth0@if3. Shown on laptop's eth0 as: eth0. The leading number identifies this interface in the output. Its name is eth0. The number is not part of its address.
- State. State: state UP. Shown on laptop's eth0 as: State. Read the state for this interface. UP does not establish that every service can answer.
- MAC address. MAC address: link/ether 02:77:10:00:00:10. Link layer. Shown on laptop's eth0 as: MAC address. link/ether introduces the MAC address. This is link-layer information.
- IPv4 address. IPv4 address: inet 10.77.10.10/24. Internet layer. Shown on laptop's eth0 as: IPv4 address. inet introduces the IPv4 address and its prefix. This is internet-layer information.
- IPv6 address. IPv6 address: inet6 fe80::77:10ff:fe00:10/64. Internet layer. Shown on laptop's eth0 as: IPv6 address. inet6 introduces the IPv6 address and its prefix. Recognize the line here; the IPv6 module explains it.
| Part of laptop’s output | What it is | Explained in |
|---|---|---|
4: eth0@if3 |
Interface number and name; the suffix describes its virtual connection | Building Your Networking Lab |
state UP |
State of this interface | Devices, Links, and Connections |
link/ether 02:77:10:00:00:10 |
MAC address line | Ethernet and Local Delivery |
inet 10.77.10.10/24 |
IPv4 address and prefix | Understanding IPv4 Addresses; Subnetting Foundations |
inet6 fe80::77:10ff:fe00:10/64 |
IPv6 address and prefix | IPv6 Foundations |
Find the interface a machine uses to talk to itself
Section titled “Find the interface a machine uses to talk to itself”The block named lo is the loopback interface, which a machine uses to communicate with itself. It is meant to be there. It is not another cable or a connection outside the lab.
Its state is UNKNOWN in this capture. That word on loopback is not a sign of a network problem. Check which interface you are reading before deciding that a word means an error.
Read a shorter list and the way out
Section titled “Read a shorter list and the way out”Run the next replay’s commands on laptop. The -br option means brief: ip -br address puts each interface’s state and IP addresses on one row. It leaves out details such as the MAC line. Use the longer form to see those details.
learner@laptop:~$ ip -br addresslo UNKNOWN 127.0.0.1/8 ::1/128
eth0@if3 UP 10.77.10.10/24 fe80::77:10ff:fe00:10/64 learner@laptop:~$ ip routedefault via 10.77.10.1 dev eth0
10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 learner@laptop:~$ ping -c 1 10.77.20.80PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data.
64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.456 ms
--- 10.77.20.80 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.456/0.456/0.456/0.000 mslearner@laptop:~$ Steps (9)
- Type
ip -br address - Press Enter
- Output:
lo UNKNOWN 127.0.0.1/8 ::1/128 eth0@if3 UP 10.77.10.10/24 fe80::77:10ff:fe00:10/64 - Type
ip route - Press Enter
- Output:
default via 10.77.10.1 dev eth0 10.77.10.0/24 dev eth0 proto kernel scope link src 10.77.10.10 - Type
ping -c 1 10.77.20.80 - Press Enter
- Output:
PING 10.77.20.80 (10.77.20.80) 56(84) bytes of data. 64 bytes from 10.77.20.80: icmp_seq=1 ttl=63 time=0.456 ms --- 10.77.20.80 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.456/0.456/0.456/0.000 ms
ip route lists routes. The line starting default says where to send messages when no other route in this list matches their destination. Here, via 10.77.10.1 names the next machine and dev eth0 names the outgoing interface. This is the default route line. You will learn how the machine chooses a route later.
The final command asks web “are you there?” The option -c 1 limits ping to one request. The recorded summary reports 1 packets transmitted, 1 received. That shows this exchange worked. It does not show that every service works. The time changes between runs; your number will differ.
Type exit and press Enter when finished. The shell prints logout and returns to the prompt naming rootvolt.
Predict: router joins two networks. How many blocks will ip address print there, not counting lo?
Check your answer
Two: eth0 and eth1. This replay shows the brief list on router. There is a row for each interface, plus lo:
learner@router:~$ ip -br addresslo UNKNOWN 127.0.0.1/8 ::1/128
eth0@if7 UP 10.77.10.1/24 fe80::77:10ff:fe00:1/64
eth1@if9 UP 10.77.20.1/24 fe80::77:20ff:fe00:1/64 learner@router:~$ Steps (3)
- Type
ip -br address - Press Enter
- Output:
lo UNKNOWN 127.0.0.1/8 ::1/128 eth0@if7 UP 10.77.10.1/24 fe80::77:10ff:fe00:1/64 eth1@if9 UP 10.77.20.1/24 fe80::77:20ff:fe00:1/64
Mistakes to recognize
Section titled “Mistakes to recognize”“lo is a network problem.” It is the expected self connection. Read eth0 for the connection to other lab machines.
“The interface number is part of the address.” The number begins a block. The address appears later on its own labeled line. Interface numbers may differ on another run.
Good to know
Section titled “Good to know”On Windows, ipconfig /all shows network settings too, including IP addresses and default gateways. The lines look different from Linux. Use the Ubuntu lab for this exercise.
Try it yourself
Section titled “Try it yourself”From the VM, enter web with netlab shell web. Run ip address and ip route. Record the interface, state, both IP address lines, and where everything else is sent. Compare with laptop. Find lines that show the same kind of setting but have different values. Then exit.
Solution
| Part | Captured on web |
|---|---|
| Interface | eth0 |
| State | UP |
| IPv4 line | inet 10.77.20.80/24 scope global eth0 |
| IPv6 line | inet6 fe80::77:20ff:fe00:80/64 scope link |
| Default route | default via 10.77.20.1 dev eth0 |
Both machines have address lines and a default-route line. The lines do the same jobs, but the values differ. Each machine has its own addresses and a route for its network.
Leave for later
Section titled “Leave for later”Understanding IPv4 Addresses and Subnetting Foundations explain address numbers and prefixes. Ethernet and Local Delivery explains MAC addresses. Reaching Another Device explains routes and ping. IPv6 Foundations explains the IPv6 line.
- Check the prompt before reading settings.
- Read each interface block separately.
- Find the address labels before working out what the numbers mean.
- Find the default line, then test the address you want to reach.
Next, Resetting and recording experiments gives you a way back after changes.
Further reading
Section titled “Further reading”- Ubuntu: ip-address manual, for interface and address listings.
- Ubuntu: ip-route manual, for route listings and the default route.
- Microsoft: ipconfig, for Windows configuration output.