From the course: Linux Foundation Cert Prep: Networking (Ubuntu)

Unlock the full course today

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

Configure a static address manually

Configure a static address manually

From the course: Linux Foundation Cert Prep: Networking (Ubuntu)

Start my 1-month free trial

Configure a static address manually

- [Instructor] In order to give this adapter a manual address I'll open up the interface's file. And I will etc network interfaces. And I'll remove and replace this iface line here. I'll keep auto enp0s3 because I want this interface to be brought up when the networking service starts up. Then I'll add iface enp0s3 inet static. This is similar to the dynamic setup but instead I have static here at then end. That means we'll be setting address info ourselves. So we need an address. I'll write address 10.0.2.20/24. You can also set the netmask explicitly if you want with the netmask command. Slash 24 would be 255.255.255.0. It's up to you, both approaches work, but be sure and follow whatever standard your organization uses. I'll get rid of that for now and put /24 back up here. I'll also need to set a gateway. 10.0.2.1 in this case. And, if you want to use a particular DNS server you can use dns-nameservers, and specify them. Leaving it off we'll rely on the gateway for name services…

Contents