Assign multiple IP addresses to single Network card in Linux

ip Command Examples to Manage Networking in Linux – The ip command provides a number of OBJECT arguments, such as: – link: Network device – address (or addr): IPv4 or IPv6 address on a device – route: Routing table entry. It also provides a number of COMMANDS for each OBJECT, such as: – add, change, del, show, more CentOS / RHEL 6 : How to add/remove additional IP # ip addr show eth0 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:71:98:9d brd ff:ff:ff:ff:ff:ff inet brd scope global eth0 inet scope global secondary eth0 inet scope global secondary eth0 inet scope global secondary eth0 inet6 fe80::5054:ff:fe71:989d/64 ip address add | del Man Page - Linux -

2.3.2. Configuring a Network Interface Using ip Commands

ip COMMAND - addr add Add an address ip addr add dev em1 Add address with netmask 24 to device em1 addr del Delete an address ip addr del dev em1 Remove address from device em1 link set Alter the status of the interface ip link set em1 up Bring em1 online ip link set em1 down Bring em1 offline ip link Linux add a second IP address, permanent or temporary Using ip command. If you prefer to use the ip command instead of ifconfig. ip address add [ip]/[mask-digits] dev [nic] Here is an example. ip address add dev eth0 With this command you can add more ip address to the same dev NIC, the second is considered as secondary. Add a permanent IP address. Ubuntu. For Ubuntu systems, edit

$ sudo ip addr add dev eth0 $ ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0:

linux - How can I set a static IP address in a Docker --cap-add=NET_ADMIN have rights for administering the net (i.e. for the /sbin/ip command) myimages/image1 image for the container /bin/sh -c "/sbin/ip addr add dev eth0 ; bash" Inside the container run ip addr add dev eth0 to add a new ip address to this container (caution: do use a free ip address now and in How to Add an Additional IP to Your Ubuntu 18.04 Server Jan 16, 2020