Determined to turn an old computer into a server (NAS, Home assistant, ...), I decided to learn about Virtualization with Xen Project on Debian. The server is expected to be used on LAN only and it has the static IP address 10.56.0.191. I am trying to create a guest on 10.56.0.192 with Xen. To this end, I followed the informations given in the Xen project's beginners guide and I have been able to create a VP guest running Debian as well.
Unfortunately, the guest has no connection at all. Still following the beginners guide, together with Xen networking, I tried to configure the host's interface, IP forwarding, ARP proxy, and IP masquerading. Unfortunately, the wiki refers to iptable which appears to had been superseeded with nftables. Therefore, I am trying to use nftables.
The guest seems to be unable to communicate (connection tested by pinging various hosts on LAN), while the host can communicate properly.
It seems I am missing something important but I am unable to find it out. Would you please help me with this issue?
I configured the host and the guest as follows.
I thank you for your help :-)
On the host
I created a bridge, xenbr0, into /etc/network/interfaces as follows:
source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # Static IP on ethernet iface enp2s0 inet manual # Bridge for Xen hypervisor auto xenbr0 iface xenbr0 inet static address 10.56.0.191 netmask 255.255.0.0 gateway 10.56.0.1 dns-nameservers 1.1.1.1 4.4.4.4 8.8.8.8 bridge_ports enp2s0 bridge_stp off bridge_maxwait 0 bridge_fd 0 The IPv4 forwarding and the ARP proxy both are enabled into /etc/sysctl.conf.
net.ipv4.ip_forward=1 net.ipv4.conf.enp2s0.proxy_arp=1 With nftables, I created a nat table and a postrouting chain. Then I added a rule for the IP masquerading.
nft add table nat nft add chain ip nat postrouting { type nat hook postrouting priority 0 \; } nft add rule nat postrouting ip saddr 10.56.0.0/16 oif enp2s0 masquerade Calling nft list ruleset returns the following:
table ip nat { chain postrouting { type nat hook postrouting priority filter; policy accept; ip saddr 10.56.0.0/16 oif "enp2s0" masquerade } } On the guest
Within the guest configuration file, the virtual interface is set as vif = [ 'ip=10.56.0.192 ,mac=00:16:3E:FA:9C:76, bridge=xenbr0' ]
I also trying to configure its network interface by setting a static IP into /etc/network/interfaces:
auto lo iface lo inet loopback auto enX0 iface enX0 inet static address 10.56.0.192 gateway 10.56.0.1 netmask 255.255.0.0 dns-nameservers 1.1.1.1 4.4.4.4 8.8.8.8