[SOLVED] access web interface from 2 different interfaces

joscha

New Member
Nov 2, 2022
5
2
3
Hi,

i have a situation where i need the proxmox web interface to be accessible trough 2 different interfaces by routed traffic.
I have set static IP's on both bridges and the web interface is reachable from systems within the same subnet of each bridge.
The web interface can also be reached by routed traffic on the bridge that i assigned the default gateway to.
However i cannot access the web interface with routed traffic on the interface that does not have a default gateway assigned.

I belive that my traffic is reaching the proxmox-server, but the answer does not get back as the proxmox-server sends it out the default gateway.
I understand that 2 default gateways cannot be assigned as normal traffic would not have a defined route out of the system.

Is there a good way to make this work?

I could probably also use NAT on the router to make the requests come from the same subnet, but i would rather contain the configuration within the proxmox-host as it makes more sense to me.


Kind Regards
Joscha
 
Hi everyone,

i figured out most the solution in the meantime.
It is actually not related to proxmox really. It's just a normal Linux thing.

In order for the system to answer on the correct interface it needs a second routing table.
I needed to setup a rule to sort all traffic coming from that interface to go to the second routing table.
Then i needed to setup a default route that is only used by the second routing table.

Code:
ip route add default via [gateway eg. 192.168.0.1] dev [interface eg. vmbr2] table 1001
ip rule add from [incoming network eg. 192.168.0.0/24] table 1001

This article helped my do it with confidence.
https://adriangiacometti.net/index....inux-host-with-2-nics-and-2-default-gateways/



The only remaining problem i have is that i don't know where to put this configuration permanently.
At the moment i just send of the commands. That should not be persistent over a reboot.
In the article they add the lines to the /et/network/interfaces file. This is however not a good idea with proxmox managing the file.
Where should i put this ideally?

Code:
iface eth1 inet static
    address 10.20.0.10
    netmask 255.255.255.0
    
    post-up ip route add default via 10.20.0.1 dev eth1 table 1001
    post-up ip rule add from 10.20.0.0/24 table 1001


Kind Regards
Joscha
 
This is however not a good idea with proxmox managing the file.
This normally shouldn't pose an issue, these changes should be kept intact when you do any other changes to the config via the GUI.
 
Thanks for the quick reply nunner.

I have added the config into the /etc/network/interfaces and then changed something uncritical via the gui.
My added config did not get changed.


Thanks

Regards
Joscha
 
  • Like
Reactions: nunner

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!