I continue with the topic of networks. I have a practical case, this time is to create a network (for a hypothetical company) and divide it into several subnets. The most normal thing would be to divide it with the mask but if one computer changes the mask the others will be seen.
So it occurred to me to use several Nat = range of Private IPs that share the same Public IP. With a DHCP Server in LXC with Debian to give the IPs of each network.
following the official Wiki: https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt
Work works. Give the IPs and have Internet access. But I create an another NAT (vmbr3 - 10.20.10.0/24) and this happen:
Thanks all !
So it occurred to me to use several Nat = range of Private IPs that share the same Public IP. With a DHCP Server in LXC with Debian to give the IPs of each network.
following the official Wiki: https://pve.proxmox.com/wiki/Networ...ith_tt_span_class_monospaced_iptables_span_tt
Code:
auto vmbr0
iface vmbr0 inet static
address 192.168.1.20
netmask 255.255.255.0
gateway 192.168.1.1
bridge-ports enp4s0f0
bridge-stp off
bridge-fd 0
auto vmbr4
iface vmbr4 inet static
address 10.10.10.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
Work works. Give the IPs and have Internet access. But I create an another NAT (vmbr3 - 10.20.10.0/24) and this happen:
- From the machines in NAT (both networks: 10.10.10.0 and 10.20.10.0) you can see the other machine in LAN with 192.168.1.67.
- From 192.168.1.67 you can not see any of the NAT networks. Neither 10.10.10.0 nor 10.20.10.0
- From the NAT machines they see each other even though they are in different networks: From 10.10.10.0 to 10.20.10.0 and successively.
Thanks all !