Hi @naga
I have experimented with iptables and containers a while ago and found that a container configured with host networking and possibly privileged mode can set iptables rules on the host. So you could set up a container/service that sets the rules you need.
@naga Can you explain your use case a bit more. Why do you need to open ports? in general to connect to balenaCloud you shouldn’t need to alter the OS iptables rules at all, it should all just work out of the box. Is that not the case for your devices?
@naga I think there is some confusion here; the documentation is referring to the ports which the device will make outbound connections to, not expect inbound connections. In its default state, IPTables will not block outbound traffic so you don’t need to add any rules for this.
Are you trying to prevent the device talking to any service on the internet EXCEPT the Balena cloud services or something else?
I need to access my device (which outside the network and connected via Cellular connection ) via Balena Cloud. - Which i couldn’t do it as of now.
Access to the device is via a VPN and is device initiated to our servers which operate on port 443. The host OS doesn’t need any inbound ports to be open for this to happen. Once this VPN is established then we give you access to SSH via the VPN using either the dashboard or balena ssh CLI.
Restrict all other access expect Balena
Just to clarify, do you mean prevent the device pulling data from other sites; like a cURL request to Google etc, or do you mean prevent services on the device accepting inbound connections from 3rd parties, like HTTP etc?