5

After launching my Node.js App which also requires BrowserSync everything is working fine and I can access the App via localhost:3000 and the given IPv4 address on the same machine running the app. But I cannot access it from my mobile or any other device on the same network without turning off the Windows default Firewall. It works great with Ubuntu on VirtualBox and just plain Windows without any issues and with an active Firewall. So it would be really nice if you know how to add an exception for WSL to the Windows Firewall Config so I don't have to turn it off completely every time :)

And by the way, I'm using Windows build 15063

Marius Niveri
  • 98
  • 1
  • 1
  • 8

2 Answers2

3

Got firewall rule enabled correctly for Node?

https://i.stack.imgur.com/JMIve.jpg

selbie
  • 100,020
  • 15
  • 103
  • 173
  • 3
    Yes, but that's the node installed on windows, according to the Task Manager the Node used by WSL is installed in WSL. If I click on path nothing happens, seems kinda strange to me... – Marius Niveri May 05 '17 at 15:17
  • 5
    Hmm.... have you thought about just adding a Firewall rule for port 3000 instead of a rule for a specific program? – selbie May 05 '17 at 17:10
2

It is little bit tricky but easy enough. Just need to use Windows PowerShell as administrator instead of distro interface directly. Otherwise it won’t work.

  • Right-click on Start menu.
  • Open PowerShell as administrator.
  • Type wsl.
  • Provide your credentials.
(Note: Now you are on the distro interface. For managing 'Windows Firewall' with ‘Ubuntu Firewall (ufw)’ commands type the following commands.)
:~#sudo service ufw start           //for starting ufw
:~#sudo systemctl enable ufw        //for enabling ufw at system start up.
&or 
:~#sudo ufw enable      //for enabling ufw at system start up.
Note: You need to start the ufw service first in order to work ufw commands for managing 'Windows Firewall'. And enable it at system start up with systemctl command.
The rest management commands are all same as main distro.