Hey y'all,
I've recently deployed Proxmox 7.2 on a server. I'm very happy with the setup so far.
Now, to save IP adresses, I would like to add a port forwarding (first only SSH, port 22(?)) to each VM, connecting over the one server IP.
What I've got so far for the Proxmox server settings (etc/network/interface). This post helped.
Now on the VM (Linux Server), I've set it up in the following way:
Then I tried to SSH into the VM:
However, I can't connect and get a timeout. Where am I wrong?
I've recently deployed Proxmox 7.2 on a server. I'm very happy with the setup so far.
Now, to save IP adresses, I would like to add a port forwarding (first only SSH, port 22(?)) to each VM, connecting over the one server IP.
What I've got so far for the Proxmox server settings (etc/network/interface). This post helped.
Code:
auto vmbr0
iface vmbr0 inet static
address A.A.A.A/xx
gateway B.B.B.B
bridge-ports eno1np0
bridge-stp off
bridge-fd 0
# Virtual Bridge 1 (local, virtual network)
auto vmbr1
iface vmbr1 inet static
address 192.168.0.254
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 '192.168.0.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o vmbr0 -j MASQUERADE
# SSH Port (22) Forwarding to VM Linux Server
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.1:22
post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 22 -j DNAT --to 192.168.0.1:22
Now on the VM (Linux Server), I've set it up in the following way:
Code:
# This is the network config written by 'subiquity'
network:
bonds:
bond0:
interfaces: []
parameters:
mode: balance-rr
ethernets:
ens18:
addresses:
- 192.168.0.1/24
gateway4: 255.255.255.0
nameservers:
addresses:
- 192.168.0.254
search: []
version: 2
Then I tried to SSH into the VM:
ssh -p 22 @A.A.A.A
However, I can't connect and get a timeout. Where am I wrong?