Vm with 2 nic: Can you explain how context works?

Dear Everybody,

For few weeks, I have the same problem when I tried to add a second nic in a vm. Impossible to my vm to contact other vm in the second network (private network)

My context:
2 networks:

  1. public network
  2. private network with ovs and vxlan.

No problem with ovs to create a vm on each network.
I’ve created a virtual router on my private network, and vms work fine.

I try to create a vm for a HAPROXY (like the OneKE CE service).
But my vm works only on the public network.
Impossible to connect to the private network. I try with Alpine and Ubuntu. Exactly the same problem.

Only the first nic works well.
If I connect the nic on the private network. Only the private network works.

I can’t find in the context script how to manage the network.
I tried to use different routes tables but with no success.

Can you help me ?

Best regards

This is probably the script you are looking for. Inside the VM it should be located at /etc/one-context/ along with other network related scripts

root@localhost:~ # ls -l /etc/one-context.d/loc-10-network*
-rwxr-xr-x  1 root  wheel  5035 Jan 26 17:24 /etc/one-context.d/loc-10-network
-rwxr-xr-x  1 root  wheel  3441 Jan 26 17:24 /etc/one-context.d/loc-10-network-pci

/etc/one-context.d/loc-10-network.d:
total 84
-rw-r--r--  1 root  wheel  15182 Jan 26 17:24 functions
-rw-r--r--  1 root  wheel   7567 Jan 26 17:24 netcfg-bsd
-rw-r--r--  1 root  wheel   9516 Jan 26 17:24 netcfg-interfaces
-rw-r--r--  1 root  wheel   8692 Jan 26 17:24 netcfg-netplan
-rw-r--r--  1 root  wheel   8205 Jan 26 17:24 netcfg-networkd
-rw-r--r--  1 root  wheel   8803 Jan 26 17:24 netcfg-nm
-rw-r--r--  1 root  wheel  10403 Jan 26 17:24 netcfg-scripts

Thanks for your reply.

I already inspect the scripts that you mentioned.

My vms work for the moment (I don’t know why) but it seems that there’s a cooldown.
May be a cache in a router in my networks or different thing that I can’t manage in my level.

I had multi-issue. May be a resolved issue had solve this problem too.
ex: The server which provides one servers is in 2 networks (one dedicated to the vms and one connected in other machine). The onegate server address was in a wrong network in the oned.conf although the server listened in all interfaces (0.0.0.0). And the vms couldn’t access to onegate server directly.

I don’t understand exactly the role of the different servers to manage the context in vms. But I continue my tests.

Thanks for all.
Best regards
Olivier