Change Port from 8006 to 443

Using this option make available all PMG Admin Dashboard.

Would be great to find a solution to just show the spam quarantine portal to users.
The only solution is to put a proxy in front of pmg web interface ad doing the filtering of url from it
 
Thank you all of you for the above code, it also helped me to switch to default port 443. I also tweaked the above code to make it easier to do it using the interfaces file

Code:
auto vmbr0
iface vmbr0 inet dhcp
    bridge-ports enx70886b82dd62
    bridge-stp off
    bridge-fd 0
    post-up iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 443 -j REDIRECT --to-ports 8006
    post-up ip6tables -t nat -A PREROUTING -p tcp -d fd00::6 --dport 443 -j REDIRECT --to-ports 8006

I added -d 192.168.1.6 and -d fd00::6 to the firewall code because all the VMs were using the SSL certificate of proxmox and were giving me errors, now all the VMs are perfectly displaying their own SSL certificates.
 
Last edited:
Thank you all of you for the above code, it also helped me to switch to default port 443. I also tweaked the above code to make it easier to do it using the interfaces file

Code:
auto vmbr0
iface vmbr0 inet dhcp
    bridge-ports enx70886b82dd62
    bridge-stp off
    bridge-fd 0
    post-up iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 443 -j REDIRECT --to-ports 8006
    post-up ip6tables -t nat -A PREROUTING -p tcp -d fd00::6 --dport 443 -j REDIRECT --to-ports 8006

I added -d 192.168.1.6 and -d fd00::6 to the firewall code because all the VMs were using the SSL certificate of proxmox and were giving me errors, now all the VMs are perfectly displaying their own SSL certificates.
Necrobump, but kudos and thanks to @saud for this idea - I've implemented it in a more flexible (and automatic) manner in my proxmox playbook.

https://forum.proxmox.com/threads/tip-remap-port-8006-to-443-in-iptables-automatically.120713/
 
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 8006
This will redirect any traffic on all interfaces, so it will end up breaking your VM's.

I added -d 192.168.1.6 and -d fd00::6 to the firewall code because all the VMs were using the SSL certificate of proxmox and were giving me errors, now all the VMs are perfectly displaying their own SSL certificates.

I figured this out after pulling my hair out, when a VM was having issues with wget/curl on port 443.
 
Last edited:
The code to automatically do this is already written, and exists at https://github.com/xrobau/ansible-proxmox-host/blob/master/roles/proxmox-base/files/fix-port-8006.sh

Simply add that as a post-up command to the interface you want to remap, and everything else is done for you. No configuration needed.

Thanks, I've instituted something similar. I just wanted to post my experience if someone else stumbles here with the same wget/curl 443 issues after blindly copying and pasting the iptables rule.

Right now, I've got a 1000+ line zsh script for setting up a Proxmox host. I've used Ansible but have been shy about using it for single deployments that I don't fully manage. How's it working for you? Are you also using Ansible to deploy a template and clone new hosts? This might not be the best avenue to hear your thoughts, but I am open to moving this discussion to a chat platform.
 
Here is my interfaces file with IPv4 and IPv6 config

Code:
auto vmbr0
allow-hotplug vmbr0
iface vmbr0 inet dhcp
    gateway 192.168.1.6
    bridge-ports eno1
    bridge-stp off
    bridge-fd 0
    post-up iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 443 -j REDIRECT --to-ports 8006


iface vmbr0 inet6 dhcp
    gateway fd00::1
    post-up ip6tables -t nat -A PREROUTING -p tcp -d fd00::6 --dport 443 -j REDIRECT --to-ports 8006
 
Last edited:
  • Like
Reactions: jordantrizz

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!