From the course: Linux System Engineer: Networking and SSH

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Change IP address and subnet mask

Change IP address and subnet mask

From the course: Linux System Engineer: Networking and SSH

Start my 1-month free trial

Change IP address and subnet mask

- [Instructor] Most distributions of the past use the ifconfig command to change the IP address and netmask in the live-config. If we still want to use this tool, we need to install a net tools package first. In this video, we will set the IP address manually, and at the end of the video, we'll set it back using DHCP. To set the live IP address and netmask using ifconfig, we just specify them for the network interface. Let's get our network interface names first. Type in ifconfig into a terminal and hit enter. So, we can see that my network interface is enp0s3. If yours is named something different, use that instead. If the network interface is not active, we could enable it by typing in sudo, space, ifconfig, space, enp0s3, space, up and it would enable it. We can also type in down to disable it. Enabling it is not necessary in my case because it's already enabled and I'm using it. To change both the IP and the netmask together, specify both for the network interface. I'm going to…

Contents