Setup two subnets with only one lan port?

I'm trying to get my proxmox server running properly in my local network, I think it's better to give the server a dedicated subnet for convenience. However, I am using Friendly NanoPi_Rtc which only have one lan port. So naturally I use switch to connect all the lan devices, and the switch doesn't support vlan (i am using my old router with dhcp disabled as a switch).

The problem here is that my router is 192.168.0.1 with all devices in 192.168.0.X. I want to setup a subnet 192.168.1.X to my proxmox server for VMs and still being able to connect to them in my 192.168.0.X subnet.

To achieve your goals, you must have a vlan aware managed switch. There is no other way to do it.

If your old router can run openwrt, you can probably use it as a managed switch. What is the brand/model of that device?

You need to pass the "other subnet" as a vlan between router and server

is it possible to make my server as a gateway at 192.168.1.1 and just route all 192.168.1.X traffic to my proxmox server

I'm not sure what your topology looks like, but it sounds like you're describing a flat network (i.e. no VLANs)... in that case, no issues.

it’s just modem to router to switch… and all my devices are connected to the switch. Is routing the traffic of 192.168.1.X to gateway 192.168.1.1 all I need to do? And do i need to NAT to give internet access to my server?

There is no routing between devices on the same subnet. They are switched (L2). Routing happens when traffic must flow between two or more networks (L3).

Routers in most home environments will run with NAT masquerading enabled on the wan. This will enable internet access to all devices behind the router, including your server if it is on that network. All devices need to know the router's address if they need internet access. If the devices are set to get their addresses via DHCP, this happens automatically. If you've setup static IPs (manually configured on each of the hosts), you must manually enter the IP, subnet mask/size, gateway, and DNS information.

thank you for replying, but what I’m trying to do is to access a 192.168.1.x server connected to a 192.168.0.X network

Can you show us your network topology?

EDIT: Specifically, it's not clear how 192.168.0.0/24 and 192.168.1.0/24 are connected to each other. Please show this in the diagram.

So the server must have an address on the 192.168.0.0/24 network. Your proxmox server can setup a 192.168.1.0/24 network for your VMs.

If your main router supports static routes, you can avoid using NAT masquerading, but if it doesn't, everything must be behind a NAT layer.

  • With masquerading disabled, you'd enter the address of your VM (192.168.1.x) directly when trying to access from your laptop.
  • If masquerading is required (i.e. main router doesn't support static routes), you'll access your VMs by entering the address that the sever has on the 192.168.0.0.24, and you'll use port fowarding to reach the VMs themselves.

How is OpenWrt involved here, though? Is that a VM on your proxmox server?

my openwrt is the main router.

Ok... in that case, as I said at the outset, you must have a managed switch if you want to use VLANs. There is no way around this.

1 Like

just ordered a vlan switch. if I have vlan switch do i still need an address on 192.168.0.x for my proxmox server? I really want my server address all stay in 1.x

Once you have a managed switch, you will setup 2 (or more) VLANs on your router and then configure the switch accordingly (trunk on the uplink, and then set the other ports as desired as access ports, with the server's port on the second VLAN.

Then, the server can have an address on the 192.168.1.0/24 network.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.