DevOps Pre-Requisite Course > Network Basics > LAB - switching and routing > Assign new IPs to each host

Hi,

I just started with DevOps Pre-Requisite Course, Network Basics > LAB - switching and routing > struck with while Assign 172.16.238.15/24 ip address to app01.
Had provided below command to assign 172.16.238.15/24 to app01 server, but receiving ‘RTNETLINK answers: Operation not permitted’ .
Had check the interface for app01 exists, it has 2 interfaces eth0, eth1.
Let me know where i have done mistake, also ‘dev’ in the command what it instructs ?

ip addr add 172.16.238.15/24 dev eth0

You need to be root user to change network settings, so use sudo

sudo ip addr add 172.16.238.15/24 dev eth0

dev is short for “device”, and the device you are adding the ip address to is the network interface identified by eth0