martes, 23 de abril de 2019

firewall windows 10 desde consola

firewall.cmd

rem 
rem http://winintro.ru/netsh_technicalreference.en/html/1a736f2d-ecf8-4780-8e0f-85c4db75230b.htm
rem 
netsh advfirewall reset

rem allow 
netsh advfirewall firewall add rule name="_ input TCP Port 80" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="_ input icmp" dir=in action=allow protocol=icmpv4

rem block 
rem netsh advfirewall firewall add rule name="_ block emby" dir=in action=block edge=yes  remoteip=any protocol=TCP localport=1900,8096,8920

rem allow 
netsh advfirewall firewall add rule name="_ allow emby 10.100.1.1" dir=in action=allow edge=yes remoteip=10.100.1.1 protocol=TCP localport=1900,8096,8920

pause

No hay comentarios: