Score:0

Two IP addresses on different networks - Netplan

ky flag

I have a server with only one network card (enp2s0) and I would like to have two IP addresses on two different networks. However, I would like to have one static IP and one using DHCP.

The first network on which I want a static IP is: 128.10.100.1/24. This first network is only composed of 2 servers: this one and an other one, which has a static IP as well 128.10.100.11 The second network on which I want a DHCP attributed address is: 10.2.14.1/24. This network is connected to internet through a router. It can have other devices and this is the reason why I don't want to have a static IP. To avoid any conflict. Here is my netplan configuration so far:

network:
 renderer: networked
 version: 2
 ethernets:
  enp2s0:
    dhcp4: true
    dhcp6: false
    addresses:
     - 128.10.100.40/24
    gateway4: 10.2.14.254
    nameservers:
     addresses: [8.8.4.4, 8.8.8.8]

My hope was to have my static IP 128.10.100.40 and a DHCP attributed IP (like 10.2.14.10 for example). However the Netplan configuration does not work, I don't receive any IP on the network 10.2.14.1/24.

Is this the correct way to do it ? Is there another way I should look at ?

Thanks for your help

NB : It is worth mentioning that I don't have access to the router, and I cannot setup an IP linked the MAC address directly on the router.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.