课程: Linux System Engineer: Networking and SSH

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Change IP address and subnet mask

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…

内容