SDN, Simple config without DHCP not working

mucfun

New Member
Jan 22, 2024
1
0
1
I tried to add a SDN Zone without dhcp but then there ist no gateway available.

Zone with DHCP disabled
vnet01 in zone with subnet 10.0.0.0/24 and Gateway 10.0.0.1 (tried SNAT activated and deactivated)

Ubuntu VM with fixed ip 10.0.0.10, subnet 10.0.0.0/24 and gateway 10.0.0.1

Would be nice if anyone could help me.
 
I've got the same problem. I wanted to use a separate subnet to test the kea-dhcp server, so no need for the dhcp option.
Created a zone, called private, automatic DHCP disabled. Then a vnet (also called private) in the zone private, not VLAN aware, as this was not needed. As for subnet on ths vnet I have 192.168.2.0/24, gateway 192.168.2.1, and SNAT enabled.

So, not much different from the original poster.

Machines on this private network cannot ping the gateway, and routing to the default gateway, as configured on the machines, does not work.

FYI, I upgraded from a previous Proxmox version and followed all the steps for adding the extra bits for SDN.
 
This is what I have:

root@pve1:/etc/network/interfaces.d# cat sdn
#version:15

auto private
iface private
address 192.168.2.1/24
post-up iptables -t nat -A POSTROUTING -s '192.168.2.0/24' -o vmbr0 -j SNAT --to-source 192.168.2.240
post-down iptables -t nat -D POSTROUTING -s '192.168.2.0/24' -o vmbr0 -j SNAT --to-source 192.168.2.240
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
bridge_ports none
bridge_stp off
bridge_fd 0
ip-forward on

root@pve1:/etc/pve/sdn# cat subnets.cfg
subnet: private-192.168.2.0-24
vnet private
gateway 192.168.2.1
snat 1

root@pve1:/etc/pve/sdn# cat vnets.cfg
vnet: private
zone private

root@pve1:/etc/pve/sdn# cat zones.cfg
simple: private
ipam pve
 
Can you post the output of ip route show on the host?
How does the network configuration inside the VM look like?
Can you post the output of qm config <vmid> of the VM that is not working?
 
I found the error, stupid me. For some reason I had in mind that my home network had 192.168.1.0, which is doesn't. It is 192.168.2.0, the same as the private subnet I configured. So now I moved the private network to 192.168.3.0/24 and gateway 192.168.3.1 and now it works fine now.

I came to realize my error when I did the ip route show command on the host, 192.168.2.240 is the IP nr of the host.

So again, stupid me, but thanks for your help in clearing this up.

Kind regards,
Albert
 
  • Like
Reactions: shanreich
okay, i have another error like that. two nics in the same net on the host and a setup following the guide of moayad.
vms can ping each other, vms can ping their gateway (10.0.0.1) and BOTH static host addresses, no other addresses from that range or hosts on the internet which is available on the host ofc ...

/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

auto eno1
iface eno1 inet static
        address 192.168.178.20/24
        gateway 192.168.178.1

auto eno2
iface eno2 inet static
        address 192.168.178.21/24

source /etc/network/interfaces.d/*

/etc/network/interfaces.d/sdn
Code:
#version:2
auto vnet0
iface vnet0
        address 10.0.0.1/24
        post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o eno1 -j SNAT --to-source 192.168.178.20
        post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o eno1 -j SNAT --to-source 192.168.178.20
        post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
        post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        ip-forward on

/etc/pve/sdn/subnets.cfg
Code:
subnet: vzone-10.0.0.0-24
        vnet vnet0
        dhcp-range start-address=10.0.0.101,end-address=10.0.0.250
        gateway 10.0.0.1
        snat 1

/etc/pve/sdn/vnets.cfg
Code:
vnet: vnet0
        zone vzone

/etc/pve/sdn/zoness.cfg
Code:
simple: vzone
        dhcp dnsmasq
        ipam pve