Block Portmapper 111

Discussion in 'Proxmox VE: Networking and Firewall' started by TechLineX, Nov 26, 2018.

  1. TechLineX

    TechLineX Member

    Joined:
    Mar 2, 2015
    Messages:
    194
    Likes Received:
    3
    Hi,

    I want to block portmapper 111 for all VMs in our 4 Node-Cluster.

    I set the firewall at the datacenter-level -> No effect
    host-level -> no effect

    vmbr0 public ip (either of the vms)
    vmrb1 internal ip (management - network)

    Firewall is set to accept all, I want to block specific ports for the vms. Its not a possability to set the rule for each vm, I want to set it as default for all vms.

    I will attach the active rules.

    Thank you in advance
     

    Attached Files:

  2. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    473
    Likes Received:
    13

    Setting via GUI is only possible by setting the rule per VM and interface.


    But you can do it by command
    Code:
     iptables -I FORWARD -p udp --dport 111 -j DROP
    
    in each Proxmox node.


    Note: you can have Proxmox's firewall active at the same which will work independently (in case of a contradiction your explicit setting for port 111 has priority). If you don't use Promox's firewall set
    Code:
    echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. TechLineX

    TechLineX Member

    Joined:
    Mar 2, 2015
    Messages:
    194
    Likes Received:
    3
    Thank you for your reply.

    I can't disable rpcbind for all nodes, because I'm using nfs-shares at eth1. It it neccessary to block port 111 only for eth0.

    Best regards
     
  4. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    473
    Likes Received:
    13
    You can add more filter criterias as you like, e.g. (assuming interface eth0 is a port at vmbr0):
    Code:
    iptables -A FORWARD -i vmbr0 -p udp --dport 111 -j DROP
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. TechLineX

    TechLineX Member

    Joined:
    Mar 2, 2015
    Messages:
    194
    Likes Received:
    3
    Is portmapper only tcp? I read it´s also tcp.

    Best regards
     
  6. Richard

    Richard Proxmox Staff Member
    Staff Member

    Joined:
    Mar 6, 2015
    Messages:
    473
    Likes Received:
    13
    AFAIK both, run
    Code:
    iptables -A FORWARD -i vmbr0 -p udp --dport 111 -j DROP
    iptables -A FORWARD -i vmbr0 -p tcp --dport 111 -j DROP
    
    For details how to use iptables study it's man page!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. TechLineX

    TechLineX Member

    Joined:
    Mar 2, 2015
    Messages:
    194
    Likes Received:
    3
    Done. I will report, if it helped. Thank you!
     
    #7 TechLineX, Dec 3, 2018
    Last edited: Dec 5, 2018
  8. TechLineX

    TechLineX Member

    Joined:
    Mar 2, 2015
    Messages:
    194
    Likes Received:
    3
    It worked. Thank you! You can close this thread.
     
  9. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    386
    Likes Received:
    32
    As thread-creator you can (and are highly encouraged to) mark the thread as solved yourself - just edit it and set the tag solved.
    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice