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 10.10.122.101/24 brd 10.10.122.255 scope global eth0 inet 10.10.122.12/24 scope global secondary eth0 inet 10.10.122.11/24 scope global secondary eth0 inet 10.10.122.13/24 scope global secondary eth0 inet6 fe80::5054:ff:fe71:989d/64 ip address add | del Man Page - Linux - SS64.com

2.3.2. Configuring a Network Interface Using ip Commands

ip COMMAND - access.redhat.com addr add Add an address ip addr add 192.168.1.1/24 dev em1 Add address 192.168.1.1 with netmask 24 to device em1 addr del Delete an address ip addr del 192.168.1.1/24 dev em1 Remove address 192.168.1.1/24 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 192.168.99.37/24 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 10.1.102.60/24 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 127.0.0.1/8 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 172.17.0.8 dev eth0 ; bash" Inside the container run ip addr add 172.17.0.8 dev eth0 to add a new ip address 172.17.0.8 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