routing between interfaces

zahnfee

New Member
Jan 19, 2024
19
1
3
Hi,

I am new to proxmox (installed yesterday) and the learning curve is much much steeper than for xen, which I have been using for years.
After several hours of digging I finally managed to create a VM, only to encounter the next issue.
The VM is connected to vmbr0.

On the host:
Code:
auto eth0
iface eth0 inet static
    address 172.16.0.251/24
    gateway 172.16.0.253
auto eth1
iface eth1 inet manual

auto eth2
iface eth2 inet manual

auto eth3
iface eth3 inet manual

auto vmbr0
iface vmbr0 inet static
    address 172.16.35.251/24
    bridge-ports eth2
    bridge-stp off
    bridge-fd 0
#bridge for vm
On the guest (VM):
Code:
auto ens18
alow-hotplug ens18
iface ens18 inet static
   address 172.16.35.99/24
   gateway 172.16.35.251

I can ping 172.16.35.251 from the VM and I can ping 172.16.0.251 from the VM.
However pinging 172.16.0.253 (my gateway to the internet) is only possible from the host, not the guest.
Apparently there is no forwarding, as tcpdump confirms:
Code:
# tcpdump -v -n -i eth0 icmp
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
10:53:48.680320 IP (tos 0x0, ttl 63, id 43832, offset 0, flags [DF], proto ICMP (1), length 84)
    172.16.35.99 > 172.16.0.253: ICMP echo request, id 55572, seq 1, length 64
10:53:49.698241 IP (tos 0x0, ttl 63, id 43981, offset 0, flags [DF], proto ICMP (1), length 84)
    172.16.35.99 > 172.16.0.253: ICMP echo request, id 55572, seq 2, length 64
...

the routing table on the host is
Code:
# ip route show
default via 172.16.0.253 dev eth0 proto kernel onlink
172.16.0.0/24 dev eth0 proto kernel scope link src 172.16.0.251
172.16.1.0/24 dev vlan101 proto kernel scope link src 172.16.1.251
172.16.35.0/24 dev vmbr0 proto kernel scope link src 172.16.35.251
host is configured to route:
Code:
# cat /proc/sys/net/ipv4/ip_forward
1
I have not changed any iptable rules on the host yet and the policy appears to be ACCEPT:
Code:
# iptables -L -n -v
Chain INPUT (policy ACCEPT 57331 packets, 13M bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 13 packets, 1092 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 57402 packets, 15M bytes)
 pkts bytes target     prot opt in     out     source               destination

What is going on here?
 
Never mind - not enough coffe this morning :) . I forgot to add the routing on the host with the 172.16.0.253 address:
Code:
ip route add 172.16.35.0/24 via 172.16.0.251 dev br0
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!