Track LXC container configs and fix network-interfaces
- proxmox/lxc/103.conf: Pi-hole LXC (firewall=0 to fix NAT via fwbr) - proxmox/lxc/104.conf: Traefik LXC - proxmox/network-interfaces: Proxmox network config with DNAT/MASQUERADE rules; fixes tpost-up typo so DNS DNAT persists across reboots Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
arch: amd64
|
||||
cores: 1
|
||||
features: nesting=1
|
||||
hostname: pihole
|
||||
memory: 512
|
||||
nameserver: 8.8.8.8
|
||||
net0: name=eth0,bridge=vmbr1,firewall=0,gw=10.10.1.1,hwaddr=BC:24:11:D6:DD:FF,ip=10.10.1.2/24,type=veth
|
||||
onboot: 1
|
||||
ostype: debian
|
||||
rootfs: local-zfs:subvol-103-disk-0,size=4G
|
||||
swap: 0
|
||||
unprivileged: 1
|
||||
@@ -0,0 +1,14 @@
|
||||
arch: amd64
|
||||
cores: 1
|
||||
hostname: traefik
|
||||
memory: 256
|
||||
nameserver: 10.10.1.2
|
||||
net0: name=eth0,bridge=vmbr1,firewall=1,gw=10.10.1.1,hwaddr=BC:24:11:8E:D3:36,ip=10.10.1.3/24,type=veth
|
||||
onboot: 1
|
||||
ostype: debian
|
||||
rootfs: local-zfs:subvol-104-disk-0,size=2G
|
||||
swap: 0
|
||||
unprivileged: 1
|
||||
|
||||
[pve:pending]
|
||||
nameserver: 8.8.8.8
|
||||
@@ -0,0 +1,54 @@
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
iface nic0 inet manual
|
||||
|
||||
auto vmbr0
|
||||
iface vmbr0 inet static
|
||||
address 192.168.1.10/24
|
||||
gateway 192.168.1.1
|
||||
bridge-ports nic0
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to-destination 10.10.1.3:80
|
||||
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to-destination 10.10.1.3:443
|
||||
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to-destination 10.10.1.3:80
|
||||
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to-destination 10.10.1.3:443
|
||||
post-up iptables -t nat -A PREROUTING -i vmbr0 -p udp --dport 53 -j DNAT --to-destination 10.10.1.2:53
|
||||
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 53 -j DNAT --to-destination 10.10.1.2:53
|
||||
post-up iptables -t nat -A POSTROUTING -p udp -d 10.10.1.2 --dport 53 -j MASQUERADE
|
||||
post-up iptables -t nat -A POSTROUTING -p tcp -d 10.10.1.2 --dport 53 -j MASQUERADE
|
||||
post-down iptables -t nat -D PREROUTING -i vmbr0 -p udp --dport 53 -j DNAT --to-destination 10.10.1.2:53
|
||||
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 53 -j DNAT --to-destination 10.10.1.2:53
|
||||
post-down iptables -t nat -D POSTROUTING -p udp -d 10.10.1.2 --dport 53 -j MASQUERADE
|
||||
post-down iptables -t nat -D POSTROUTING -p tcp -d 10.10.1.2 --dport 53 -j MASQUERADE
|
||||
|
||||
|
||||
source /etc/network/interfaces.d/*
|
||||
|
||||
auto vmbr1
|
||||
iface vmbr1 inet static
|
||||
address 10.10.1.1/24
|
||||
bridge-ports none
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
post-up iptables -t nat -A POSTROUTING -s 10.10.1.0/24 -o vmbr0 -j MASQUERADE
|
||||
post-down iptables -t nat -D POSTROUTING -s 10.10.1.0/24 -o vmbr0 -j MASQUERADE
|
||||
|
||||
auto vmbr2
|
||||
iface vmbr2 inet static
|
||||
address 10.10.2.1/24
|
||||
bridge-ports none
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
post-up iptables -t nat -A POSTROUTING -s 10.10.2.0/24 -o vmbr0 -j MASQUERADE
|
||||
post-down iptables -t nat -D POSTROUTING -s 10.10.2.0/24 -o vmbr0 -j MASQUERADE
|
||||
|
||||
auto vmbr3
|
||||
iface vmbr3 inet static
|
||||
address 10.10.3.1/24
|
||||
bridge-ports none
|
||||
bridge-stp off
|
||||
bridge-fd 0
|
||||
post-up iptables -t nat -A POSTROUTING -s 10.10.3.0/24 -o vmbr0 -j MASQUERADE
|
||||
post-down iptables -t nat -D POSTROUTING -s 10.10.3.0/24 -o vmbr0 -j MASQUERADE
|
||||
Reference in New Issue
Block a user