[Debate] Consultas sobre el "firewall" del SP2 de XP.

05/04/2004 - 19:20 por JM Tella Llop [MVP Windows] | Informe spam
Tal y como comenté ayer, estaré por qeuí una hora o dos, y por tanto, las consultas que tengais sobre dicho cortafuegos, irlas exponiendo colgando de este mismo hilo. No se responderá a ningun mensaje que no sea del tema del cortafuegos. No se responderá tampoco a los mensajes del TROLL de turno.

Vuelvo a pegar debajo el articulo de ayer. La dinamica normal es que voy a poner un articulo semanal -de diversas indoles-, normalmente los Domingos, y al dia siguiente, duranto un par de horas, responder a las consultas.


CONFIGURACION DEL FIREWALL DE XP - SP2. MEDIANTE COMANDOS DE LINEA.
-

Independientemente de la configuración mediante el interface grafico que hemos visto en el articulo anterior, existen en XP - SP2, la posibilidad de configurarlo mediante comandos de linea. Esto añade potencia a ciertas opciones de configuracion -como por ejemplo añadir un rango de puertos, lo cual es pesado de hacer con el interface grafico- y sobre todo, es la herramienta imprescindible de los Administradores de red que necesitan cambiar remotamente opciones.

Recordemos, que el firewall del SP2, no solo controla entradas en nuestra maquina sino que además, controla en las salidas:

1) Que programas están autorizados (solicita permiso para cualquier programa que intenta por primera vez abrir un servicio en "LISTENING").

2) Permite definir que puertos están autorizados. Esto añade además el definir su alcance: si es para todas las IP's, si esa regla es solo para la subred local, o incluso definir manualmente el ambito (SCOPE), por ejemplo: 157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet

3) Control independiente por cada interface de red. Puede establecerse una configuracion global para todas las interfaces y modificarse a nivel de interface en particular.

4) Control total y correcto del trafico multicast. (los actuales firewall de terceros solo actuan en trafico unicast, y se las ven y se las desean para multicast -protocolos de radiodifusion o de streaming de video).


TIP - SCRIPT de LINEA DE COMANDO PARA ABRIR / CERRAR UN RANGO DE PUERTOS


Podeis crearos un bat (o cmd), con las siguientes lineas:


@echo off
setlocal enabledelayedexpansion
set protocol=%2
if "%protocol%." == "." set protocol=ALL
for /f "tokens=1,2 delims=-" %%i in ("%1") do set /a var1=%%i&set /a var2=%%j
for /l %%i in (%var1%,1,%var2%) do netsh firewall set portopening %protocol% %%i P%%i %3 >nul
endlocal
goto :EOF

Imaginemos que le llamamos tcpopen.bat. Esto, admite la sintaxis:

tcpopen 5000-5100 [TCP | UDP | ALL]

lo anterior, abrirá los puertos del 5000 al 5100 en lo indicado en el segundo parametro. Es decir, TCP, UDP o ALL. Por defecto, si no le indicamos el segundo parametro, será ALL.

Igualmente el comando anterior, permite un tercer parámetro: DISABLE. Si indicamos ese tercer parametro, cerrará los puertos previamente abiertos.

Evidentemente las modificaciones se verán reflejadas inmediatamente en la interface grafica. Elñ comando anterior, lo he preparado para que cree las entradas P5000 P5001... P5100 en la interface grafica con esos nombres.


COMANDO DE LINEA NETSH
-

La implementacion del manejo del firewall mediante comando comando de linea, lo ha realizado Microsoft a traves del comandos NETSH. Dicho comando ya exitiá en el XP y XP SP1 normales, y permite la modificacion de parametros de la red, reinstalacion del stadck tcp, guardar una configuracion del tcp y poder restaurarla, etc. Es decir era un comando generico de control de red y sus interfaces. La implementacion del SP2 lo que hace es posibilitarle tambien la configuracion del firewall.

Si ejecutamos netsh en una ventan de comandos (cmd.exe), veremos un prompt:

netsh>

tecleando una interrogacion, nos muestra los comandos posibles:

The following commands are available:

Commands in this context:
.. - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline mode.
add - Adds a configuration entry to a list of entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline mode.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
p2p - Changes to the `netsh p2p' context.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface p2p ras routing winsock

To view help for a command, type the command, followed by a space, and then
type ?.

En particular, el comando firewall. Si tecleamos firewall, nos mostrará:

netsh firewall>

y con una ?:

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets firewall configuration to default.
set - Sets firewall configuration.
show - Shows firewall configuration.

To view help for a command, type the command, followed by a space, and then
type ?.

Es especialmente potente el comando ADD:

netsh firewall>add portopening
The syntax supplied for this command is not valid. Check help for the correct sy
ntax.

add portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

Adds firewall port configuration.

Parameters:

protocol - Port protocol.
TCP - Transmission Control Protocol (TCP).
UDP - User Datagram Protocol (UDP).
ALL - All protocols.

port - Port number.

name - Port name.

mode - Port mode (optional).
ENABLE - Allow through firewall (default).
DISABLE - Do not allow through firewall.

scope - Port scope (optional).
ALL - Allow all traffic through firewall (default).
SUBNET - Allow only local network (subnet) traffic through firewall.
CUSTOM - Allow only specified traffic through firewall.

addresses - Custom scope addresses (optional).

profile - Configuration profile (optional).
CURRENT - Current profile (default).
DOMAIN - Domain profile.
STANDARD - Standard profile.
ALL - All profiles.

interface - Interface name (optional).

Remarks: 'profile' and 'interface' may not be specified together.
'scope' and 'interface' may not be specified together.
'scope' must be 'CUSTOM' to specify 'addresses'.

Examples:

add portopening TCP 80 MyWebPort

add portopening UDP 500 IKE ENABLE ALL

add portopening ALL 53 DNS ENABLE CUSTOM

157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet
add portopening protocol = TCP port = 80 name = MyWebPort

add portopening protocol = UDP port = 500 name = IKE mode = ENABLE scope ALL
add portopening protocol = ALL port = 53 name = DNS mode = ENABLE

scope = CUSTOM
addresses = 157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet


El resto de parámetro podeis comprobarlos y vereis que permiten la configuracion completa del firewall, inclusive mediante más opciones de las que da la propia interface grafica.




Jose Manuel Tella Llop
MVP - Windows
jmtella@compuserve.com
http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.

Preguntas similare

Leer las respuestas

#11 JM Tella Llop [MVP Windows]
05/04/2004 - 20:12 | Informe spam
Simplemente en el que hace de server. No hace falta en el resto de los equipos, a pesar que ahora ya puede ponerse sin problemas de perder la red, ya que existen opciones para permitir solo en la "subred local" el cliente y servicios de Microsoft y por tanto se vería la red.

Nunca me han gustado las opciones de firewall por hardware. Un firewall por hardware, no elimina el firewall por software, y este ultimo debe ponerse siempre (aunque sea como complementario del anterior). Cualquier manual basico de seguridad, siempre te dirá lo mismo.

Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.




"Andrés Farias" <andresfariasARROBAmsnPUNTOcom> wrote in message news:
Hola JM Tella, un gusto de verte por estos lados nuevamente.
Con respecto al tema, si estamos en una red sin servidor de dominio y con
una maquina XP Pro sirviendo las conexiones a Internet y asumiendo
estaciones igualmente XP, ¿como seria la configuración recomendada?
¿Firewall en cada equipo o solamente en el que hace de server?
En estos casos, seguirá siendo mejor la opcion de firewall mediante hardware
o con SP2 esto cambia?
Saludos
Andrés Farias.cl


"JM Tella Llop [MVP Windows]" escribió en el mensaje
news:#
Tal y como comenté ayer, estaré por qeuí una hora o dos, y por tanto, las
consultas que tengais sobre dicho cortafuegos, irlas exponiendo colgando de
este mismo hilo. No se responderá a ningun mensaje que no sea del tema del
cortafuegos. No se responderá tampoco a los mensajes del TROLL de turno.

Vuelvo a pegar debajo el articulo de ayer. La dinamica normal es que voy a
poner un articulo semanal -de diversas indoles-, normalmente los Domingos, y
al dia siguiente, duranto un par de horas, responder a las consultas.

-
CONFIGURACION DEL FIREWALL DE XP - SP2. MEDIANTE COMANDOS DE LINEA.
-

Independientemente de la configuración mediante el interface grafico que
hemos visto en el articulo anterior, existen en XP - SP2, la posibilidad de
configurarlo mediante comandos de linea. Esto añade potencia a ciertas
opciones de configuracion -como por ejemplo añadir un rango de puertos, lo
cual es pesado de hacer con el interface grafico- y sobre todo, es la
herramienta imprescindible de los Administradores de red que necesitan
cambiar remotamente opciones.

Recordemos, que el firewall del SP2, no solo controla entradas en nuestra
maquina sino que además, controla en las salidas:

1) Que programas están autorizados (solicita permiso para cualquier programa
que intenta por primera vez abrir un servicio en "LISTENING").

2) Permite definir que puertos están autorizados. Esto añade además el
definir su alcance: si es para todas las IP's, si esa regla es solo para la
subred local, o incluso definir manualmente el ambito (SCOPE), por ejemplo:
157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet

3) Control independiente por cada interface de red. Puede establecerse una
configuracion global para todas las interfaces y modificarse a nivel de
interface en particular.

4) Control total y correcto del trafico multicast. (los actuales firewall de
terceros solo actuan en trafico unicast, y se las ven y se las desean para
multicast -protocolos de radiodifusion o de streaming de video).


TIP - SCRIPT de LINEA DE COMANDO PARA ABRIR / CERRAR UN RANGO DE PUERTOS


Podeis crearos un bat (o cmd), con las siguientes lineas:


@echo off
setlocal enabledelayedexpansion
set protocol=%2
if "%protocol%." == "." set protocol=ALL
for /f "tokens=1,2 delims=-" %%i in ("%1") do set /a var1=%%i&set /a
var2=%%j
for /l %%i in (%var1%,1,%var2%) do netsh firewall set portopening %protocol%
%%i P%%i %3 >nul
endlocal
goto :EOF

Imaginemos que le llamamos tcpopen.bat. Esto, admite la sintaxis:

tcpopen 5000-5100 [TCP | UDP | ALL]

lo anterior, abrirá los puertos del 5000 al 5100 en lo indicado en el
segundo parametro. Es decir, TCP, UDP o ALL. Por defecto, si no le indicamos
el segundo parametro, será ALL.

Igualmente el comando anterior, permite un tercer parámetro: DISABLE. Si
indicamos ese tercer parametro, cerrará los puertos previamente abiertos.

Evidentemente las modificaciones se verán reflejadas inmediatamente en la
interface grafica. Elñ comando anterior, lo he preparado para que cree las
entradas P5000 P5001... P5100 en la interface grafica con esos nombres.


COMANDO DE LINEA NETSH
-

La implementacion del manejo del firewall mediante comando comando de linea,
lo ha realizado Microsoft a traves del comandos NETSH. Dicho comando ya
exitiá en el XP y XP SP1 normales, y permite la modificacion de parametros
de la red, reinstalacion del stadck tcp, guardar una configuracion del tcp y
poder restaurarla, etc. Es decir era un comando generico de control de red y
sus interfaces. La implementacion del SP2 lo que hace es posibilitarle
tambien la configuracion del firewall.

Si ejecutamos netsh en una ventan de comandos (cmd.exe), veremos un prompt:

netsh>

tecleando una interrogacion, nos muestra los comandos posibles:

The following commands are available:

Commands in this context:
.. - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline mode.
add - Adds a configuration entry to a list of entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline mode.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
p2p - Changes to the `netsh p2p' context.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface p2p ras routing winsock

To view help for a command, type the command, followed by a space, and then
type ?.

En particular, el comando firewall. Si tecleamos firewall, nos mostrará:

netsh firewall>

y con una ?:

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets firewall configuration to default.
set - Sets firewall configuration.
show - Shows firewall configuration.

To view help for a command, type the command, followed by a space, and then
type ?.

Es especialmente potente el comando ADD:

netsh firewall>add portopening
The syntax supplied for this command is not valid. Check help for the
correct sy
ntax.

add portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

Adds firewall port configuration.

Parameters:

protocol - Port protocol.
TCP - Transmission Control Protocol (TCP).
UDP - User Datagram Protocol (UDP).
ALL - All protocols.

port - Port number.

name - Port name.

mode - Port mode (optional).
ENABLE - Allow through firewall (default).
DISABLE - Do not allow through firewall.

scope - Port scope (optional).
ALL - Allow all traffic through firewall (default).
SUBNET - Allow only local network (subnet) traffic through firewall.
CUSTOM - Allow only specified traffic through firewall.

addresses - Custom scope addresses (optional).

profile - Configuration profile (optional).
CURRENT - Current profile (default).
DOMAIN - Domain profile.
STANDARD - Standard profile.
ALL - All profiles.

interface - Interface name (optional).

Remarks: 'profile' and 'interface' may not be specified together.
'scope' and 'interface' may not be specified together.
'scope' must be 'CUSTOM' to specify 'addresses'.

Examples:

add portopening TCP 80 MyWebPort

add portopening UDP 500 IKE ENABLE ALL

add portopening ALL 53 DNS ENABLE CUSTOM

157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet
add portopening protocol = TCP port = 80 name = MyWebPort

add portopening protocol = UDP port = 500 name = IKE mode = ENABLE
scope > ALL
add portopening protocol = ALL port = 53 name = DNS mode = ENABLE

scope = CUSTOM
addresses = 157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet


El resto de parámetro podeis comprobarlos y vereis que permiten la
configuracion completa del firewall, inclusive mediante más opciones de las
que da la propia interface grafica.




Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no
otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.






Respuesta Responder a este mensaje
#12 Pepe
05/04/2004 - 20:14 | Informe spam
¿Puede mandar unas capturitas para abrir boca? :)

Tal y como comenté ayer, estaré por qeuí una hora o dos,


y por tanto, las consultas que tengais sobre dicho
cortafuegos, irlas exponiendo colgando de este mismo
hilo. No se responderá a ningun mensaje que no sea del
tema del cortafuegos. No se responderá tampoco a los
mensajes del TROLL de turno.

Vuelvo a pegar debajo el articulo de ayer. La dinamica


normal es que voy a poner un articulo semanal -de
diversas indoles-, normalmente los Domingos, y al dia
siguiente, duranto un par de horas, responder a las
consultas.




-
CONFIGURACION DEL FIREWALL DE XP - SP2. MEDIANTE


COMANDOS DE LINEA.



-

Independientemente de la configuración mediante el


interface grafico que hemos visto en el articulo
anterior, existen en XP - SP2, la posibilidad de
configurarlo mediante comandos de linea. Esto añade
potencia a ciertas opciones de configuracion -como por
ejemplo añadir un rango de puertos, lo cual es pesado de
hacer con el interface grafico- y sobre todo, es la
herramienta imprescindible de los Administradores de red
que necesitan cambiar remotamente opciones.

Recordemos, que el firewall del SP2, no solo controla


entradas en nuestra maquina sino que además, controla en
las salidas:

1) Que programas están autorizados (solicita permiso


para cualquier programa que intenta por primera vez abrir
un servicio en "LISTENING").

2) Permite definir que puertos están autorizados. Esto


añade además el definir su alcance: si es para todas las
IP's, si esa regla es solo para la subred local, o
incluso definir manualmente el ambito (SCOPE), por
ejemplo:
157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet

3) Control independiente por cada interface de red.


Puede establecerse una configuracion global para todas
las interfaces y modificarse a nivel de interface en
particular.

4) Control total y correcto del trafico multicast. (los


actuales firewall de terceros solo actuan en trafico
unicast, y se las ven y se las desean para multicast -
protocolos de radiodifusion o de streaming de video).


TIP - SCRIPT de LINEA DE COMANDO PARA ABRIR / CERRAR UN


RANGO DE PUERTOS



Podeis crearos un bat (o cmd), con las siguientes lineas:


@echo off
setlocal enabledelayedexpansion
set protocol=%2
if "%protocol%." == "." set protocol=ALL
for /f "tokens=1,2 delims=-" %%i in ("%1") do set /a


var1=%%i&set /a var2=%%j
for /l %%i in (%var1%,1,%var2%) do netsh firewall set


portopening %protocol% %%i P%%i %3 >nul
endlocal
goto :EOF

Imaginemos que le llamamos tcpopen.bat. Esto, admite la


sintaxis:

tcpopen 5000-5100 [TCP | UDP | ALL]

lo anterior, abrirá los puertos del 5000 al 5100 en lo


indicado en el segundo parametro. Es decir, TCP, UDP o
ALL. Por defecto, si no le indicamos el segundo
parametro, será ALL.

Igualmente el comando anterior, permite un tercer


parámetro: DISABLE. Si indicamos ese tercer parametro,
cerrará los puertos previamente abiertos.

Evidentemente las modificaciones se verán reflejadas


inmediatamente en la interface grafica. Elñ comando
anterior, lo he preparado para que cree las entradas
P5000 P5001... P5100 en la interface grafica con esos
nombres.


COMANDO DE LINEA NETSH
-

La implementacion del manejo del firewall mediante


comando comando de linea, lo ha realizado Microsoft a
traves del comandos NETSH. Dicho comando ya exitiá en el
XP y XP SP1 normales, y permite la modificacion de
parametros de la red, reinstalacion del stadck tcp,
guardar una configuracion del tcp y poder restaurarla,
etc. Es decir era un comando generico de control de red y
sus interfaces. La implementacion del SP2 lo que hace es
posibilitarle tambien la configuracion del firewall.

Si ejecutamos netsh en una ventan de comandos (cmd.exe),


veremos un prompt:

netsh>

tecleando una interrogacion, nos muestra los comandos


posibles:

The following commands are available:

Commands in this context:
... - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline


mode.
add - Adds a configuration entry to a list of


entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline


mode.
delete - Deletes a configuration entry from a


list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface'


context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
p2p - Changes to the `netsh p2p' context.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface p2p ras routing winsock

To view help for a command, type the command, followed


by a space, and then
type ?.

En particular, el comando firewall. Si tecleamos


firewall, nos mostrará:

netsh firewall>

y con una ?:

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets firewall configuration to


default.
set - Sets firewall configuration.
show - Shows firewall configuration.

To view help for a command, type the command, followed


by a space, and then
type ?.

Es especialmente potente el comando ADD:

netsh firewall>add portopening
The syntax supplied for this command is not valid. Check


help for the correct sy
ntax.

add portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

Adds firewall port configuration.

Parameters:

protocol - Port protocol.
TCP - Transmission Control Protocol (TCP).
UDP - User Datagram Protocol (UDP).
ALL - All protocols.

port - Port number.

name - Port name.

mode - Port mode (optional).
ENABLE - Allow through firewall (default).
DISABLE - Do not allow through firewall.

scope - Port scope (optional).
ALL - Allow all traffic through firewall


(default).
SUBNET - Allow only local network (subnet) traffic


through firewall.
CUSTOM - Allow only specified traffic through


firewall.

addresses - Custom scope addresses (optional).

profile - Configuration profile (optional).
CURRENT - Current profile (default).
DOMAIN - Domain profile.
STANDARD - Standard profile.
ALL - All profiles.

interface - Interface name (optional).

Remarks: 'profile' and 'interface' may not be


specified together.
'scope' and 'interface' may not be specified


together.
'scope' must be 'CUSTOM' to


specify 'addresses'.

Examples:

add portopening TCP 80 MyWebPort

add portopening UDP 500 IKE ENABLE ALL

add portopening ALL 53 DNS ENABLE CUSTOM




157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet
add portopening protocol = TCP port = 80 name =


MyWebPort

add portopening protocol = UDP port = 500 name =


IKE mode = ENABLE scope > ALL
add portopening protocol = ALL port = 53 name =


DNS mode = ENABLE

scope = CUSTOM
addresses =


157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet


El resto de parámetro podeis comprobarlos y vereis que


permiten la configuracion completa del firewall,
inclusive mediante más opciones de las que da la propia
interface grafica.




Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de


ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and


confers no rights.
You assume all risk for your use.




.

Respuesta Responder a este mensaje
#13 JM Tella Llop [MVP Windows]
05/04/2004 - 20:17 | Informe spam
Es que no tiene que hacer nada.. :-)
Puede modificar luego lo que quiera, pero ya vereis la confiuracion por defecto. Ademas, se activa en TODAS las interface de red nada mas instalarlo. Y en instalaciones integradas, lo mismo. Y si añadimos una interface de red nueva, automaticamente la protegerá el firewall.

Y consumo de CPU cero.

Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.




"Tomás" wrote in message news:
:-)

Ya Jose, pero te pregunto los motivos para un usuario doméstico. Y no me
refiero a que sea mas facil configurarlo en temas digamos ilegales, sino en
configurarlo aceptablemente de una manera sencilla, entorno gráfico,
digamos, si conjuga seguridad, utilización pequeña de recursos,
sencillez.


Saludos



"JM Tella Llop [MVP Windows]" escribió en el mensaje
news:
Prefiero el del SP2.
Y sabes que yo soy, y he sido vicioso del Sygate, siendo ese el *unico* que
aconsejaba.

Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no
otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.




"Tomás" wrote in message
news:
Hola Jose Manuel


En comparación con el Sygate por ejemplo, que ventajas o limitaciones


posee?

EL sygate está considerando de lo mejorcito, pero quizás sea un poco
complicado para usuarios caseros. Ofrece funcionalidades parecidas (o
mejores) y es mas sencillo de manejar?

Saludos y un placer verte por aquí de nuevo

Tomás



"JM Tella Llop [MVP Windows]" escribió en el mensaje
news:%
Tal y como comenté ayer, estaré por qeuí una hora o dos, y por tanto, las
consultas que tengais sobre dicho cortafuegos, irlas exponiendo colgando


de
este mismo hilo. No se responderá a ningun mensaje que no sea del tema del
cortafuegos. No se responderá tampoco a los mensajes del TROLL de turno.

Vuelvo a pegar debajo el articulo de ayer. La dinamica normal es que voy a
poner un articulo semanal -de diversas indoles-, normalmente los Domingos,


y
al dia siguiente, duranto un par de horas, responder a las consultas.

CONFIGURACION DEL FIREWALL DE XP - SP2. MEDIANTE COMANDOS DE LINEA.
-

Independientemente de la configuración mediante el interface grafico que
hemos visto en el articulo anterior, existen en XP - SP2, la posibilidad


de
configurarlo mediante comandos de linea. Esto añade potencia a ciertas
opciones de configuracion -como por ejemplo añadir un rango de puertos, lo
cual es pesado de hacer con el interface grafico- y sobre todo, es la
herramienta imprescindible de los Administradores de red que necesitan
cambiar remotamente opciones.

Recordemos, que el firewall del SP2, no solo controla entradas en nuestra
maquina sino que además, controla en las salidas:

1) Que programas están autorizados (solicita permiso para cualquier


programa
que intenta por primera vez abrir un servicio en "LISTENING").

2) Permite definir que puertos están autorizados. Esto añade además el
definir su alcance: si es para todas las IP's, si esa regla es solo para


la
subred local, o incluso definir manualmente el ambito (SCOPE), por


ejemplo:
157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet

3) Control independiente por cada interface de red. Puede establecerse una
configuracion global para todas las interfaces y modificarse a nivel de
interface en particular.

4) Control total y correcto del trafico multicast. (los actuales firewall


de
terceros solo actuan en trafico unicast, y se las ven y se las desean para
multicast -protocolos de radiodifusion o de streaming de video).


TIP - SCRIPT de LINEA DE COMANDO PARA ABRIR / CERRAR UN RANGO DE PUERTOS


Podeis crearos un bat (o cmd), con las siguientes lineas:


@echo off
setlocal enabledelayedexpansion
set protocol=%2
if "%protocol%." == "." set protocol=ALL
for /f "tokens=1,2 delims=-" %%i in ("%1") do set /a var1=%%i&set /a
var2=%%j
for /l %%i in (%var1%,1,%var2%) do netsh firewall set portopening


%protocol%
%%i P%%i %3 >nul
endlocal
goto :EOF

Imaginemos que le llamamos tcpopen.bat. Esto, admite la sintaxis:

tcpopen 5000-5100 [TCP | UDP | ALL]

lo anterior, abrirá los puertos del 5000 al 5100 en lo indicado en el
segundo parametro. Es decir, TCP, UDP o ALL. Por defecto, si no le


indicamos
el segundo parametro, será ALL.

Igualmente el comando anterior, permite un tercer parámetro: DISABLE. Si
indicamos ese tercer parametro, cerrará los puertos previamente abiertos.

Evidentemente las modificaciones se verán reflejadas inmediatamente en la
interface grafica. Elñ comando anterior, lo he preparado para que cree las
entradas P5000 P5001... P5100 en la interface grafica con esos nombres.


COMANDO DE LINEA NETSH
-

La implementacion del manejo del firewall mediante comando comando de


linea,
lo ha realizado Microsoft a traves del comandos NETSH. Dicho comando ya
exitiá en el XP y XP SP1 normales, y permite la modificacion de parametros
de la red, reinstalacion del stadck tcp, guardar una configuracion del tcp


y
poder restaurarla, etc. Es decir era un comando generico de control de red


y
sus interfaces. La implementacion del SP2 lo que hace es posibilitarle
tambien la configuracion del firewall.

Si ejecutamos netsh en una ventan de comandos (cmd.exe), veremos un


prompt:

netsh>

tecleando una interrogacion, nos muestra los comandos posibles:

The following commands are available:

Commands in this context:
.. - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline mode.
add - Adds a configuration entry to a list of entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline mode.
delete - Deletes a configuration entry from a list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface' context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
p2p - Changes to the `netsh p2p' context.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface p2p ras routing winsock

To view help for a command, type the command, followed by a space, and


then
type ?.

En particular, el comando firewall. Si tecleamos firewall, nos mostrará:

netsh firewall>

y con una ?:

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets firewall configuration to default.
set - Sets firewall configuration.
show - Shows firewall configuration.

To view help for a command, type the command, followed by a space, and


then
type ?.

Es especialmente potente el comando ADD:

netsh firewall>add portopening
The syntax supplied for this command is not valid. Check help for the
correct sy
ntax.

add portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

Adds firewall port configuration.

Parameters:

protocol - Port protocol.
TCP - Transmission Control Protocol (TCP).
UDP - User Datagram Protocol (UDP).
ALL - All protocols.

port - Port number.

name - Port name.

mode - Port mode (optional).
ENABLE - Allow through firewall (default).
DISABLE - Do not allow through firewall.

scope - Port scope (optional).
ALL - Allow all traffic through firewall (default).
SUBNET - Allow only local network (subnet) traffic through firewall.
CUSTOM - Allow only specified traffic through firewall.

addresses - Custom scope addresses (optional).

profile - Configuration profile (optional).
CURRENT - Current profile (default).
DOMAIN - Domain profile.
STANDARD - Standard profile.
ALL - All profiles.

interface - Interface name (optional).

Remarks: 'profile' and 'interface' may not be specified together.
'scope' and 'interface' may not be specified together.
'scope' must be 'CUSTOM' to specify 'addresses'.

Examples:

add portopening TCP 80 MyWebPort

add portopening UDP 500 IKE ENABLE ALL

add portopening ALL 53 DNS ENABLE CUSTOM

157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet
add portopening protocol = TCP port = 80 name = MyWebPort

add portopening protocol = UDP port = 500 name = IKE mode = ENABLE
scope >> ALL
add portopening protocol = ALL port = 53 name = DNS mode = ENABLE

scope = CUSTOM
addresses = 157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet


El resto de parámetro podeis comprobarlos y vereis que permiten la
configuracion completa del firewall, inclusive mediante más opciones de


las
que da la propia interface grafica.




Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y


no
otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no


rights.
You assume all risk for your use.









Respuesta Responder a este mensaje
#14 Jose A. Glez.
05/04/2004 - 20:17 | Informe spam
Hola Jose!!!

Veamos:

Yo nunca me conecto directamente a Internet, siempre tengo una máquina que me hace de
Server/firewall. La cuestión es, ¿como se desde el equipo "remoto" conectado a ese
Server el comportamiento del firewall (suponiendo que ese Server tenga instalado un
XP-SP2)? Me refiero a esas notificaciones que hace si algún programa intenta acceder
a Internet, y demás cosas.


Otra cosilla: Imagina que tengo un Server con Windows 2003 Server y su firewall
"instalado", ¿que ocurriría si también tengo configurado el firewall de XP-SP2 en uno
de los "clientes"?


Y la ultima: ¿se sabe si este firewall va a estar implementado en revisiones futuras
de Windows 2003 Server?



. . . . . . . . . . . . . .
Jose A. Glez. ·
. . .
Artículos, Actualizaciones, Programas...
http://www.worldseth.net
. . . . . . . . . . . . . .
Respuesta Responder a este mensaje
#15 JM Tella Llop [MVP Windows]
05/04/2004 - 20:24 | Informe spam
Tienes la documentacion oficial de MS en:
http://www.microsoft.com/technet/pr...xpsp2.mspx

y capturas en:
http://www.microsoft.com/technet/co...g0204.mspx

Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.




"Pepe" wrote in message news:159fb01c41b39$dc271090$
¿Puede mandar unas capturitas para abrir boca? :)

Tal y como comenté ayer, estaré por qeuí una hora o dos,


y por tanto, las consultas que tengais sobre dicho
cortafuegos, irlas exponiendo colgando de este mismo
hilo. No se responderá a ningun mensaje que no sea del
tema del cortafuegos. No se responderá tampoco a los
mensajes del TROLL de turno.

Vuelvo a pegar debajo el articulo de ayer. La dinamica


normal es que voy a poner un articulo semanal -de
diversas indoles-, normalmente los Domingos, y al dia
siguiente, duranto un par de horas, responder a las
consultas.




-
CONFIGURACION DEL FIREWALL DE XP - SP2. MEDIANTE


COMANDOS DE LINEA.



-

Independientemente de la configuración mediante el


interface grafico que hemos visto en el articulo
anterior, existen en XP - SP2, la posibilidad de
configurarlo mediante comandos de linea. Esto añade
potencia a ciertas opciones de configuracion -como por
ejemplo añadir un rango de puertos, lo cual es pesado de
hacer con el interface grafico- y sobre todo, es la
herramienta imprescindible de los Administradores de red
que necesitan cambiar remotamente opciones.

Recordemos, que el firewall del SP2, no solo controla


entradas en nuestra maquina sino que además, controla en
las salidas:

1) Que programas están autorizados (solicita permiso


para cualquier programa que intenta por primera vez abrir
un servicio en "LISTENING").

2) Permite definir que puertos están autorizados. Esto


añade además el definir su alcance: si es para todas las
IP's, si esa regla es solo para la subred local, o
incluso definir manualmente el ambito (SCOPE), por
ejemplo:
157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet

3) Control independiente por cada interface de red.


Puede establecerse una configuracion global para todas
las interfaces y modificarse a nivel de interface en
particular.

4) Control total y correcto del trafico multicast. (los


actuales firewall de terceros solo actuan en trafico
unicast, y se las ven y se las desean para multicast -
protocolos de radiodifusion o de streaming de video).


TIP - SCRIPT de LINEA DE COMANDO PARA ABRIR / CERRAR UN


RANGO DE PUERTOS



Podeis crearos un bat (o cmd), con las siguientes lineas:


@echo off
setlocal enabledelayedexpansion
set protocol=%2
if "%protocol%." == "." set protocol=ALL
for /f "tokens=1,2 delims=-" %%i in ("%1") do set /a


var1=%%i&set /a var2=%%j
for /l %%i in (%var1%,1,%var2%) do netsh firewall set


portopening %protocol% %%i P%%i %3 >nul
endlocal
goto :EOF

Imaginemos que le llamamos tcpopen.bat. Esto, admite la


sintaxis:

tcpopen 5000-5100 [TCP | UDP | ALL]

lo anterior, abrirá los puertos del 5000 al 5100 en lo


indicado en el segundo parametro. Es decir, TCP, UDP o
ALL. Por defecto, si no le indicamos el segundo
parametro, será ALL.

Igualmente el comando anterior, permite un tercer


parámetro: DISABLE. Si indicamos ese tercer parametro,
cerrará los puertos previamente abiertos.

Evidentemente las modificaciones se verán reflejadas


inmediatamente en la interface grafica. Elñ comando
anterior, lo he preparado para que cree las entradas
P5000 P5001... P5100 en la interface grafica con esos
nombres.


COMANDO DE LINEA NETSH
-

La implementacion del manejo del firewall mediante


comando comando de linea, lo ha realizado Microsoft a
traves del comandos NETSH. Dicho comando ya exitiá en el
XP y XP SP1 normales, y permite la modificacion de
parametros de la red, reinstalacion del stadck tcp,
guardar una configuracion del tcp y poder restaurarla,
etc. Es decir era un comando generico de control de red y
sus interfaces. La implementacion del SP2 lo que hace es
posibilitarle tambien la configuracion del firewall.

Si ejecutamos netsh en una ventan de comandos (cmd.exe),


veremos un prompt:

netsh>

tecleando una interrogacion, nos muestra los comandos


posibles:

The following commands are available:

Commands in this context:
... - Goes up one context level.
? - Displays a list of commands.
abort - Discards changes made while in offline


mode.
add - Adds a configuration entry to a list of


entries.
alias - Adds an alias.
bridge - Changes to the `netsh bridge' context.
bye - Exits the program.
commit - Commits changes made while in offline


mode.
delete - Deletes a configuration entry from a


list of entries.
diag - Changes to the `netsh diag' context.
dump - Displays a configuration script.
exec - Runs a script file.
exit - Exits the program.
firewall - Changes to the `netsh firewall' context.
help - Displays a list of commands.
interface - Changes to the `netsh interface'


context.
offline - Sets the current mode to offline.
online - Sets the current mode to online.
p2p - Changes to the `netsh p2p' context.
popd - Pops a context from the stack.
pushd - Pushes current context on stack.
quit - Exits the program.
ras - Changes to the `netsh ras' context.
routing - Changes to the `netsh routing' context.
set - Updates configuration settings.
show - Displays information.
unalias - Deletes an alias.
winsock - Changes to the `netsh winsock' context.

The following sub-contexts are available:
bridge diag firewall interface p2p ras routing winsock

To view help for a command, type the command, followed


by a space, and then
type ?.

En particular, el comando firewall. Si tecleamos


firewall, nos mostrará:

netsh firewall>

y con una ?:

Commands in this context:
? - Displays a list of commands.
add - Adds firewall configuration.
delete - Deletes firewall configuration.
dump - Displays a configuration script.
help - Displays a list of commands.
reset - Resets firewall configuration to


default.
set - Sets firewall configuration.
show - Shows firewall configuration.

To view help for a command, type the command, followed


by a space, and then
type ?.

Es especialmente potente el comando ADD:

netsh firewall>add portopening
The syntax supplied for this command is not valid. Check


help for the correct sy
ntax.

add portopening
[ protocol = ] TCP|UDP|ALL
[ port = ] 1-65535
[ name = ] name
[ [ mode = ] ENABLE|DISABLE
[ scope = ] ALL|SUBNET|CUSTOM
[ addresses = ] addresses
[ profile = ] CURRENT|DOMAIN|STANDARD|ALL
[ interface = ] name ]

Adds firewall port configuration.

Parameters:

protocol - Port protocol.
TCP - Transmission Control Protocol (TCP).
UDP - User Datagram Protocol (UDP).
ALL - All protocols.

port - Port number.

name - Port name.

mode - Port mode (optional).
ENABLE - Allow through firewall (default).
DISABLE - Do not allow through firewall.

scope - Port scope (optional).
ALL - Allow all traffic through firewall


(default).
SUBNET - Allow only local network (subnet) traffic


through firewall.
CUSTOM - Allow only specified traffic through


firewall.

addresses - Custom scope addresses (optional).

profile - Configuration profile (optional).
CURRENT - Current profile (default).
DOMAIN - Domain profile.
STANDARD - Standard profile.
ALL - All profiles.

interface - Interface name (optional).

Remarks: 'profile' and 'interface' may not be


specified together.
'scope' and 'interface' may not be specified


together.
'scope' must be 'CUSTOM' to


specify 'addresses'.

Examples:

add portopening TCP 80 MyWebPort

add portopening UDP 500 IKE ENABLE ALL

add portopening ALL 53 DNS ENABLE CUSTOM




157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet
add portopening protocol = TCP port = 80 name =


MyWebPort

add portopening protocol = UDP port = 500 name =


IKE mode = ENABLE scope > ALL
add portopening protocol = ALL port = 53 name =


DNS mode = ENABLE

scope = CUSTOM
addresses =


157.0.0.1,172.0.0.0/8,10.0.0.0/255.0.0.0,LocalSubnet


El resto de parámetro podeis comprobarlos y vereis que


permiten la configuracion completa del firewall,
inclusive mediante más opciones de las que da la propia
interface grafica.




Jose Manuel Tella Llop
MVP - Windows

http://www.multingles.net/jmt.htm

Este mensaje se proporciona "como está" sin garantías de


ninguna clase, y no otorga ningún derecho.

This posting is provided "AS IS" with no warranties, and


confers no rights.
You assume all risk for your use.




.

Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente AnteriorRespuesta Tengo una respuesta
Search Busqueda sugerida