How to set multiple IP addresses on a NIC?
by Jason.nix from LinuxQuestions.org on (#6D8KM)
Hello,
To set the multiple IP addresses on a NIC, I must create a virtual NIC?
For example, If my real NIC name is enp0s3, then I must:
Code:# touch /etc/network/interfaces.d/enp0s3:0
# nano /etc/network/interfaces.d/enp0s3:0
auto enp0s3:0
iface enp0s3:0 inet static
address 10.0.5.20
netmask 255.255.255.0
#
# systemctl restart networkingIs it mandatory? Can I add the above lines to the real NIC file (/etc/network/interfaces.d/enp0s3)?
Thank you.
To set the multiple IP addresses on a NIC, I must create a virtual NIC?
For example, If my real NIC name is enp0s3, then I must:
Code:# touch /etc/network/interfaces.d/enp0s3:0
# nano /etc/network/interfaces.d/enp0s3:0
auto enp0s3:0
iface enp0s3:0 inet static
address 10.0.5.20
netmask 255.255.255.0
#
# systemctl restart networkingIs it mandatory? Can I add the above lines to the real NIC file (/etc/network/interfaces.d/enp0s3)?
Thank you.