User Tools

Site Tools


wiki:add_additional_ip_address_interface

Add additional ip address on interface

ip addr add 94.130.84.168/27 dev eth0
root@server:~# ip addr add 94.130.84.168/27 dev eth0

/etc/network/interfaces example (for persistence over reboot):

root@server ~ # cat /etc/network/interfaces
### Hetzner Online GmbH installimage

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback
iface lo inet6 loopback

auto eno1
iface eno1 inet static
  address 94.130.84.168
  netmask 255.255.255.128
  gateway 94.130.84.129
  # route 94.130.84.128/25 via 94.130.84.129
  up route add -net 94.130.84.128 netmask 255.255.255.128 gw 94.130.84.129 dev eno1
  up ip addr add 94.130.84.239/25 dev eno1
  down ip addr del 94.130.84.239/25 dev eno1
  up ip addr add 94.130.84.240/25 dev eno1
  down ip addr del 94.130.84.240/25 dev eno1
  up ip addr add 94.130.84.231/25 dev eno1
  down ip addr del 94.130.84.231/25 dev eno1
  up ip addr add 94.130.84.230/25 dev eno1
  down ip addr del 94.130.84.230/25 dev eno1
  up ip addr add 94.130.84.229/25 dev eno1
  down ip addr del 94.130.84.229/25 dev eno1

iface eno1 inet6 static
  address 2a01:4f8:c0:20cb::2
  netmask 64
  gateway fe80::1

auto br0
iface br0 inet static
  address 10.10.10.1
  netmask 255.255.255.0
  bridge_ports none
  bridge_fd 0
  bridge_stp off
  bridge_maxwait 5
  pre-up /sbin/brctl addbr br0

Tested on

See also

References

wiki/add_additional_ip_address_interface.txt · Last modified: 2022/09/19 23:38 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki