philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.46k stars 217 forks source link

UFW & Dynamic Ports #301

Closed velafamily closed 3 years ago

velafamily commented 3 years ago

How do I make UFW work with dynamic ports? This was an issue brought up in issue #91 but no solution was every made available.

AndreasPantle commented 3 years ago

If your server is in a LAN environment you can open LAN connections by adding the rule:

$ sudo ufw allow from 192.168.xxx.0/24
$ sudo ufw disable && sudo ufw enable

This means that all incoming connections from 192.168.xxx.1 up to 192.168.xxx.254 are allowed. Don't know if someone uses somethink better - I guess with UFW there is no other possibility in this matter.

philippe44 commented 3 years ago

I don't have plans currently to restrict port usage to a certain range. It sounds simple but there are some complications that I don't have time to deal with currently

philippe44 commented 3 years ago

Well, finally done. See -a or parameter

felix-albrecht commented 2 years ago

I tried to limit the port range using -a, but still some other ports were used. Using netstat -tulpn | grep air, I found the following additional ports (neither listed in the Readme nor specified with -a) being used while playing:

@AndreasPantle's workaround works fine:

$ sudo ufw allow from 192.168.xxx.0/24 $ sudo ufw disable && sudo ufw enable

But I think it would be great to limit those two dynamic ports to the range defined with -a.