Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Offical apps | Community apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Discuss
  3. Replace iptables with nftables

Replace iptables with nftables

Scheduled Pinned Locked Moved Discuss
firewall
15 Posts 7 Posters 7.6k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • girishG girish

    Thanks for the info. We in fact want to move to ufw instead. It seems most users are more comfortable with ufw and not iptables which is too low level.

    murgeroM
    murgeroM
    murgero
    App Dev
    wrote on last edited by
    #3

    @girish I don't expect that to take too much time too, UFW's backend is iptables so really just sorting out the UFW cli / api should be relatively simple****

    --
    https://urgero.org
    ~ Professional Nerd. Freelance Programmer. ~

    1 Reply Last reply
    1
    • girishG girish

      Thanks for the info. We in fact want to move to ufw instead. It seems most users are more comfortable with ufw and not iptables which is too low level.

      yusfY
      yusfY
      yusf
      wrote on last edited by
      #4

      @girish Is it happening? Was looking to customize some settings but I'm not touching iptables.

      1 Reply Last reply
      0
      • A
        A
        ariachris56
        wrote on last edited by
        #5

        Glad to know about it.

        1 Reply Last reply
        0
        • girishG girish

          Thanks for the info. We in fact want to move to ufw instead. It seems most users are more comfortable with ufw and not iptables which is too low level.

          W
          W
          will
          wrote on last edited by
          #6

          @girish UFW isn't really its own firewall, its a front end for iptables, and probably nftables.

          1 Reply Last reply
          0
          • girishG girish

            Thanks for the info. We in fact want to move to ufw instead. It seems most users are more comfortable with ufw and not iptables which is too low level.

            robiR
            robiR
            robi
            wrote on last edited by
            #7

            @girish the main issue with ufw is that is doesn't support managing any rules in specific chains. (for example the important INPUT chain or the custom CLOUDRON chain).

            We need ways for at least this to be able to fully manage the range of apps and services we need.

            Conscious tech

            1 Reply Last reply
            1
            • girishG
              girishG
              girish
              Staff
              wrote on last edited by
              #8

              @robi In the recent release, we added a way to blacklist IPs and also whitelist additional ports. Do these two things cover most cases? https://docs.cloudron.io/networking/#firewall

              robiR 1 Reply Last reply
              1
              • girishG girish

                @robi In the recent release, we added a way to blacklist IPs and also whitelist additional ports. Do these two things cover most cases? https://docs.cloudron.io/networking/#firewall

                robiR
                robiR
                robi
                wrote on last edited by
                #9

                @girish ooh that's great! I knew about the blocklist (bye-bye .cn) but not the whitelist.

                can you add a udp port example to the whitelist docs?

                I keep struggling to keep mosh accessible after a cloudron reboot and it would make sense to simply add mosh support to the default install. (thoughts?)

                It's also not clear if IP port ranges are supported in the whitelist. (mosh ports listed as: 60000-60010 or 60000:60010 didn't work.)

                Do I need to list all the ports in the range?

                Also, why does the cloudron-firewall restart take so long? 15-20secs is disturbingly long.

                json is ugh, does it make sense to also convert it to plain text like the blocklist?

                Conscious tech

                1 Reply Last reply
                0
                • girishG
                  girishG
                  girish
                  Staff
                  wrote on last edited by
                  #10

                  @robi said in Replace iptables with nftables:

                  can you add a udp port example to the whitelist docs?

                  Currently, only tcp is supported. I will look into adding udp, it should be straightforward.

                  Also, why does the cloudron-firewall restart take so long? 15-20secs is disturbingly long.

                  I think that's the time the kernel is taking to add your blocklist to ipset. I imagine it's pretty big? How many entries does it have?

                  robiR 1 Reply Last reply
                  1
                  • girishG girish

                    @robi said in Replace iptables with nftables:

                    can you add a udp port example to the whitelist docs?

                    Currently, only tcp is supported. I will look into adding udp, it should be straightforward.

                    Also, why does the cloudron-firewall restart take so long? 15-20secs is disturbingly long.

                    I think that's the time the kernel is taking to add your blocklist to ipset. I imagine it's pretty big? How many entries does it have?

                    robiR
                    robiR
                    robi
                    wrote on last edited by
                    #11

                    Currently, only tcp is supported. I will look into adding udp, it should be straightforward.

                    Hmm, then why am I seeing some of the udp ports I added? 😕

                    I also see iptables -L | grep 50000:51000
                    what is this for? looks like a typo for mosh (60000-61000)

                    I think that's the time the kernel is taking to add your blocklist to ipset. I imagine it's pretty big? How many entries does it have?

                    oh yes, 13,687 IPs in blocklist now (cn, ru), 25 seconds to load. 😦

                    Conscious tech

                    girishG 1 Reply Last reply
                    0
                    • robiR robi

                      Currently, only tcp is supported. I will look into adding udp, it should be straightforward.

                      Hmm, then why am I seeing some of the udp ports I added? 😕

                      I also see iptables -L | grep 50000:51000
                      what is this for? looks like a typo for mosh (60000-61000)

                      I think that's the time the kernel is taking to add your blocklist to ipset. I imagine it's pretty big? How many entries does it have?

                      oh yes, 13,687 IPs in blocklist now (cn, ru), 25 seconds to load. 😦

                      girishG
                      girishG
                      girish
                      Staff
                      wrote on last edited by
                      #12

                      @robi said in Replace iptables with nftables:

                      I also see iptables -L | grep 50000:51000

                      That's for the TURN server.

                      1 Reply Last reply
                      0
                      • robiR
                        robiR
                        robi
                        wrote on last edited by
                        #13

                        ooh that's usable for mosh too with the -p parameter.

                        let's just make mosh a default thing please!

                        Conscious tech

                        1 Reply Last reply
                        0
                        • robiR
                          robiR
                          robi
                          wrote on last edited by
                          #14

                          I'm installing a new Cloudron and got bit by this again.. can't get mosh to work without manually tweaking iptables.

                          iptables -I INPUT 1 -p udp --dport 60000:60010 -j ACCEPT
                          
                          

                          Conscious tech

                          1 Reply Last reply
                          0
                          • robiR
                            robiR
                            robi
                            wrote on last edited by robi
                            #15

                            Ran into this again, with an easy solution since Cloudron already allows the TURN server port range, we can adopt it for mosh client side.

                            Simply explicitly ask for a starting port and it will connect:
                            mosh -p 50000 user@host
                            

                            Otherwise server side: set the MOSH_PORT env var so mosh-server starts searching from port 50000:

                            # System-wide for all users
                            echo 'export MOSH_PORT=50000' | tee /etc/profile.d/mosh.sh
                            

                            Conscious tech

                            1 Reply Last reply
                            0

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Bookmarks
                            • Search