User Tools

Site Tools


wiki:add_additional_ip_address_interface

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:add_additional_ip_address_interface [2022/09/19 21:38] – created antisawiki:add_additional_ip_address_interface [2025/10/14 12:22] (current) – [Add additional ip address on interface] remove duplicate code antisa
Line 1: Line 1:
-{{tag>networking}}+{{tag>networking routing ipv4}}
  
 ====== Add additional ip address on interface ====== ====== Add additional ip address on interface ======
 +First make sure the interface is up:
  
 +  ip link set eth0 up
 +
 +then add an address:
   ip addr add 94.130.84.168/27 dev eth0   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): ///etc/network/interfaces// example (for persistence over reboot):
Line 55: Line 56:
 </code> </code>
  
 +===== Adding routes =====
 +Change IPs accordingly:
 +
 +If you get an error:
 +  # ip route add default via 15.235.15.254 dev br0
 +  Error: Nexthop has invalid gateway.
 +
 +You have to add a route to the gateway itself:
 +  ip route add 15.235.15.0/24 dev br0 src 15.235.15.201 metric 100
 +
 +Then you can add a default route.
 +  ip route add default via 15.235.15.254 dev br0
 +
 +If you get:
 +  connect: Network unreachable
 +when trying to ping an address, you have to add a default route.
 ====== Tested on ====== ====== Tested on ======
   *    * 
  
 ====== See also ====== ====== See also ======
 +  * [[set_up_ipv6_host_vm|Set up IPv6 on host and VM]] - example of IPv6 addresses and routes
 ====== References ====== ====== References ======
 +  * https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf
  
wiki/add_additional_ip_address_interface.1663623520.txt.gz · Last modified: 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