this post was submitted on 02 Oct 2023
27 points (93.5% liked)

Selfhosted

40113 readers
988 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hello everyone,

I hope you're all doing well. I'm reaching out for some guidance on a network project I've been working on.

Currently, my setup includes:

  • OPNsense Firewall: This is running smoothly and is the primary gateway for my network.
  • Proxmox Server: I'm in the process of integrating this. It has a single Ethernet port for network connectivity.

My primary goal is to deploy a Pi-hole instance on the Proxmox server. I'm still weighing whether to go with a Docker container or a standalone VM for this.

Here's the crux: My existing network devices operate in the 192.168.0.1xx IP range. I'd like the Pi-hole to be on a different subnet, specifically 192.168.33.xxx. This move is mainly for organization and segmentation purposes.

Considering the single Ethernet port on the Proxmox server and my intended setup, is this feasible? Moreover, are there specific challenges or configurations I should be aware of?

Any insights, advice, or shared experiences would be invaluable.

Thank you for your collective wisdom and time!

Uptate

so for all you people looking I managed to get it to work with this guide

Firewall Rules:

Allow Main LAN to Access the New Subnet:

Log into the OPNsense web interface. Go to Firewall > Rules > [LAN]. Click on the + button to add a new rule. Set the following:

Action: Pass
Interface: LAN
Protocol: Any (or you can specify TCP/UDP if needed)
Source: LAN net
Destination: Single host or alias and input 192.168.33.0/24.

Add a description (e.g., "Allow LAN to Access 192.168.33 Subnet"). Click Save.

Allow New Subnet to Reply (or initiate to the Main LAN):

  • Go to Firewall > Rules > [Your VLAN interface, e.g., VLAN33].
  • Click on the + button to add a new rule.
Set the following:
Action: Pass
Interface: [Your VLAN interface]
Protocol: Any (or you can specify TCP/UDP if needed)
Source: 192.168.33.0/24
Destination: LAN net
  • Add a description (e.g., "Allow 192.168.33 Subnet to Access LAN").
  • Click Save.

Apply Changes:

After creating the rules, click on Apply Changes to ensure the rules take effect.

top 8 comments
sorted by: hot top controversial new old
[–] [email protected] 8 points 1 year ago (1 children)

Look into vlan.

Basically allows you to have different subnets rubbing on a physical network card.

It is possible what you want to do and not that complicated.

[–] [email protected] 1 points 1 year ago

thank you I will have a look.

[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (1 children)

Subnetting and VLANs can get hard to conceptualize when they are virtualized on a single machine.

I'd suggest going to draw.io and making a logical network diagram so that you can have a reference when setting up your network.

If you want EVERYTHING going through piHole which is on a different subnet, easiest way I've done it was make going through the pihole necessary to make it to the default gateway.

But if you have a different situation for pihole you can set up DNS relays.

[–] [email protected] 2 points 1 year ago

yeah I should draw it out first. Right now traffic is routed trough a pihole on a raspberry

I think I will keep this route

[–] [email protected] 3 points 1 year ago (1 children)

It should work just fine. the proxmox just sets up a bridge to the virtual interface when you install it and after that, VMs you deploy will appear in to everything else on the network as if connected through a switch.

However, watch out about it your routing tables. If the pihole isn't on the same network (regardless of if it is virtualized or not), you have to tell other computers on the network how to reach that other network, by making changes to their routing table, or the one in your router (that is literally its job, after all).

[–] [email protected] 1 points 1 year ago

ok I wil keep in mind to leave the vlan in the same network

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Slapping another NIC and using OPNsense as a VM on Proxmox has numerous advantages, as well as a few drawbacks. And opnsense has plugins that do what pihole does if you wanted to investigate that a bit before you commit.

[–] [email protected] 1 points 1 year ago

Oh opnsense has this pihole filtering in it it self I did not know that I have to check that out