Configuring Interfaces and the Host-to-Network Layer

On a Linux system, you connect the Internet layer to the physical medium, such as an Ethernet network or a modem-based connection, with a network interface. Common network interface names are eth0 (the first Ethernet card in the computer) and ppp0 (a PPP interface).

The most important command for viewing or manually configuring the network interface settings is ifconfig. To see your current interface's settings, run this command:

ifconfig -a

You do not need the -a in Linux, but other Unix variants require this option. The output should look something like this:

 eth0 Link encap:Ethernet HWaddr 00:40:05:A0:7F:96 inet addr:10.1.2.2 Bcast:10.1.2.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST ...

Get How Linux Works now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.