Results 1 to 3 of 3

Thread: Allow incoming connection from a Subnet (ufw)

  1. #1
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu

    Allow incoming connection from a Subnet (ufw)

    Hi,

    I want to open a port to this specific subnet 172.16.0.0/24.

    I read the community doc.

    This is the command to allow incoming connections from a subnet

    Allow by Subnet

    You may use a net mask :
    sudo ufw allow from 192.168.1.0/24
    But seems like the above ^^ command will open all ports to that subnet. I want to open only a single port.

    I tried this but didn't work

    Code:
    sudo ufw allow from 172.16.0.0/24 any <port>
    ERROR: Wrong number of arguments
    What is right command ?
    Lubuntu 20.04

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Allow incoming connection from a Subnet (ufw)

    That would be

    Code:
    sudo ufw allow from 172.16.0.0/24 to any port <port>
    I think

  3. #3
    Join Date
    Jan 2010
    Location
    India
    Beans
    Hidden!
    Distro
    Lubuntu

    Re: Allow incoming connection from a Subnet (ufw)

    Worked ! Thanks.
    Lubuntu 20.04

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •