0

I have firewall opened for few ports in my network. I have created one listening port which will just listen for a connection and will create one and again enter into a listening port. I m using boost asio for connection establishment. Listening port is one for which firewall is opened. But the actual port on which connection has been established is assigned by OS. Does OS makes sure the port assigned on actual connection is enabled on firewall or how can I determine that.

Nothing but need to understand how it works

girsarda
  • 1
  • 1
  • If you are listening on one port, the connection requests coming on that port will be accepted. I am not sure what do you mean by "the actual port on which connection has been established is assigned by OS". Maybe you can share a [mre] and explain better. – kiner_shah Jan 02 '23 at 10:07
  • Usually firewalls only block incoming traffic, so there is no issue. – sehe Jan 02 '23 at 10:25
  • The OS typically picks the port that the *client* uses to connect to the listening port. But on on the *server* side, all accepted connections use the listening port. A TCP connection is uniquely identified by the combination of client ip/port and server ip/port. – Remy Lebeau Jan 03 '23 at 00:13

0 Answers0