The four settings every PC needs
- An IP address in the right subnet
- The subnet mask (or prefix length)
- A default gateway: the router on its own subnet
- A DNS server, to turn names into addresses
Windows
ipconfig for the basics, ipconfig /all for everything: MAC address ("Physical Address"), whether DHCP is on, the DHCP server and lease times, and DNS servers.
In NetLab
▶ PC1 NetLab Windows-style command prompt. Type help to see the commands. C:\Users\student>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : PC1 Primary Dns Suffix . . . . . . . : Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No Ethernet adapter Ethernet: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : NetLab Gigabit Network Adapter Physical Address. . . . . . . . . : 00-1A-33-D5-62-B1 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::11db:99de:fbce:36d1%12(Preferred) IPv4 Address. . . . . . . . . . . : 10.1.1.11(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.1.1.1 DNS Servers . . . . . . . . . . . :
Linux
ip addr (address, prefix, MAC on the link/ether line), ip route (the default via line is the gateway), and the DNS server is in /etc/resolv.conf.
In NetLab
▶ PC2 student@PC2:~$ ip addr 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 noprefixroute valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:1a:f2:3a:a4:ee brd ff:ff:ff:ff:ff:ff inet 10.1.1.12/24 brd 10.1.1.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::21a:f2ff:fe3a:a4ee/64 scope link valid_lft forever preferred_lft forever student@PC2:~$ ip route default via 10.1.1.1 dev eth0 10.1.1.0/24 dev eth0 proto kernel scope link src 10.1.1.12
macOS
ifconfig en0 (the mask is shown in hex: 0xffffff00 = 255.255.255.0), netstat -rn for the gateway, and ipconfig getifaddr en0 for just the address.
In NetLab
▶ PC3 PC3:~ student$ ifconfig en0 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:1a:dd:6c:93:9f inet6 fe80::d8e3:54d0:f8c5:988d%en0 prefixlen 64 secured scopeid 0x4 inet 10.1.1.13 netmask 0xffffff00 broadcast 10.1.1.255 media: autoselect (100baseT <full-duplex>) status: active PC3:~ student$ netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire default 10.1.1.1 UGScg en0 10.1.1.0/24 link#4 UCS en0 PC3:~ student$ ipconfig getifaddr en0 10.1.1.13
| Need | Windows | Linux | macOS |
|---|---|---|---|
| Address + mask | ipconfig | ip addr | ifconfig |
| Gateway | ipconfig | ip route | netstat -rn |
| MAC | ipconfig /all or getmac | ip link | ifconfig |
| DNS server | ipconfig /all | cat /etc/resolv.conf | scutil --dns |
| ARP cache | arp -a | ip neigh | arp -a |
Tip: In NetLab the IP settings button on any PC opens the same kind of dialog you'd use on a real desktop. Either way, always check the result with the commands above.