Add firewall rule to whole cluster via pvesh

Conacious

New Member
Sep 17, 2019
24
0
1
31
Hi everyone,
I would like to add a firewall rule via pvesh API to the cluster.

First, my proxmox version:

Code:
root@tfg ~ # pveversion -v
proxmox-ve: 6.1-2 (running kernel: 4.19.0-8-amd64)
pve-manager: 6.1-8 (running version: 6.1-8/806edfe1)
pve-kernel-helper: 6.1-8
pve-kernel-5.3: 6.1-6
pve-kernel-5.3.18-3-pve: 5.3.18-3
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libpve-access-control: 6.0-6
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.0-17
libpve-guest-common-perl: 3.0-5
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 3.2.1-1
lxcfs: 4.0.1-pve1
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-3
pve-cluster: 6.1-4
pve-container: 3.0-23
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.0-10
pve-firmware: 3.0-7
pve-ha-manager: 3.0-9
pve-i18n: 2.0-4
pve-qemu-kvm: 4.1.1-4
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-7
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1


Also the cluster status:

Code:
root@tfg ~ # pvecm status
Cluster information
-------------------
Name:             tfgcluster
Config Version:   1
Transport:        knet
Secure auth:      on

Quorum information
------------------
Date:             Mon Apr 20 09:46:57 2020
Quorum provider:  corosync_votequorum
Nodes:            1
Node ID:          0x00000001
Ring ID:          1.5
Quorate:          Yes

Votequorum information
----------------------
Expected votes:   1
Highest expected: 1
Total votes:      1
Quorum:           1 
Flags:            Quorate

Membership information
----------------------
    Nodeid      Votes Name
0x00000001          1 192.168.100.1 (local)
Docs:

pvesh create /nodes/{node}/firewall/rules

It works fine when I put the node name in {node} but is not working with the name of the cluster.

Example: Cluster name is tfgcluster with one unique node tfg.

this doesn't work:
pvesh create /nodes/tfgcluster/firewall/rules --action 'DROP' --type 'in' --dport 111 --proto tcp

with the next error:

hostname lookup 'tfgcluster' failed - failed to get address info for: tfgcluster: Name or service not known


this works:
pvesh create /nodes/tfg/firewall/rules --action 'DROP' --type 'in' --dport 111 --proto tcp

What do I have to put on {node} to add a rule on the Datacenter?

Thanks.
 

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!