You are not allowed to force users to share something in order to get Wi-Fi access, as you can read in the platform policy:
4.5 Only incentivize a person to log into your app, enter a promotion on
your app’s Page, or check-in at a place. Don’t incentivize other
actions.
That being said, you may want to take a look at this article about Facebook Wi-Fi: https://www.facebook.com/help/126760650808045/
solved Server Programming On Router(linux)