VMware Global Community
vaysala507
Contributor
Contributor

Editar reglas de firewalls del esxi 5

hola me podrian ayudar como puedo editar las reglas de firewalls de un vmware esxi 5, el cliente me esta solicitando que ciertos puertos deban cerrar o que por ejemplo el puerto 903 este en tcp y solo entrante.

gracias por su ayuda

0 Kudos
5 Replies
escaprix
Hot Shot
Hot Shot

Hola como estas??? me fije en este documento (http://pubs.vmware.com/vsphere-50/topic/com.vmware.ICbase/PDF/vsphere-esxi-vcenter-server-50-securit...) pagina 20 y justamente el puerto que mencionas de ejemplo es solo  Entrante

Que otros puertos te estarian pidiendo modificar??

Saludos.

0 Kudos
dquintana
Virtuoso
Virtuoso

Hola vaysala

dale una mirada a estos links, te copié el ejemplo que citan.

Espero te sirva cualquier duda acá estamos.

Smiley Wink

Diego Quintana

Creating custom firewall rules in VMware ESXi 5.0

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=200822...

  1. Open an SSH connection to the host. For more information, see Using ESXi Shell in ESXi 5.0 (2004746).

  2. List the firewall rules by running the command:

    # esxcli network firewall ruleset list

    Name            Enabled
    --------------  -----------------
    sshServer       true
    sshClient       false
    nfsClient       true
    dhcp            true
    dns             true
    snmp            true
    ntpClient       false
    CIMHttpServer   true
    CIMHttpsServer  true
    CIMSLP          true
    iSCSI           true


    Note: On the vSphere Client, the DNS service is open on port 53 for UDP only.

To enable the DNS service on port 53 for TCP:

  1. Back up the /etc/vmware/firewall/service.xml file by running the command:

    # cp /etc/vmware/firewall/service.xml /etc/vmware/firewall/service.xml.bak

  2. Modify the access permissions of the service.xml file to allow writes by running the chmod command:

    To allow writes:

    # chmod 644 /etc/vmware/firewall/service.xml

    To toggle the sticky bit flag:

    # chmod +t /etc/vmware/firewall/service.xml

  3. Open the service.xml file in a text editor.

  4. Add this rule to the service.xml file:

    <service id="0032">
    <id>DNSTCPOut</id>
    <rule id='0000'>
    <direction>outbound</direction>
    <protocol>tcp</protocol>
    <porttype>dst</porttype>
    <port>53</port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
    </service>


    Rule set configuration file example:

    <ConfigRoot>
    <service id='0000'>
    <id>serviceName</id>
    <rule id = '0000'>
    <direction>inbound</direction>
    <protocol>tcp</protocol>
    <porttype>dst</porttype>
    <port>80</port>
    </rule>
    <rule id='0001'>
    <direction>inbound</direction>
    <protocol>tcp</protocol>
    <porttype>src</porttype>
    <port>
    <begin>1020</begin>
    <end>1050</end>
    </port>
    </rule>
    <enabled>true</enabled>
    <required>false</required>
    </service>
    </ConfigRoot>


    For more information, see the Rule Set Configuration Files section of the vSphere 5.0 Security Guide.

  5. Revert the access permissions of the service.xml file to the read-only default by running the command:

    # chmod 444 /etc/vmware/firewall/service.xml

  6. Refresh the firewall rules for the changes to take effect by running the command:

    # esxcli network firewall refresh

    or

    # localcli network firewall refresh

    Note: This setting does not persist after a reboot. To make it persist, see Changing the port used by SSH on an ESXi 5.0 host (2011818).

  7. List the rules again to confirm by running the command:

    # esxcli network firewall ruleset list

    Name            Enabled
    --------------  -----------------
    sshServer       true
    sshClient       false
    nfsClient       true
    dhcp            true
    dns             true
    snmp            true
    ntpClient       false
    CIMHttpServer   true
    CIMHttpsServer  true
    CIMSLP          true
    iSCSI           true
    DNSTCPOut       true

Ing. Diego Quintana - VMware Communities Moderator - Co Founder & CEO at Wetcom Group - vEXPERT From 2010 to 2020- VCP, VSP, VTSP, VAC - Twitter: @daquintana - Blog: http://www.wetcom.com-blog & http://www.diegoquintana.net - Enjoy the vmware communities !!!

0 Kudos
vaysala507
Contributor
Contributor

ok la unica forma es editar por consola??? no hay un ambiente grafico para esto???

0 Kudos
dquintana
Virtuoso
Virtuoso

Hasta donde tengo entendido, no.

http://pubs.vmware.com/vsphere-51/index.jsp?lang=en_US

Diego

Ing. Diego Quintana - VMware Communities Moderator - Co Founder & CEO at Wetcom Group - vEXPERT From 2010 to 2020- VCP, VSP, VTSP, VAC - Twitter: @daquintana - Blog: http://www.wetcom.com-blog & http://www.diegoquintana.net - Enjoy the vmware communities !!!

0 Kudos
sanmarfe
Expert
Expert

Estimados, tengan en cuenta que los cambios personalizados en el firewall del esxi se pierden con cada reinicio.

Deberian realizar un backup del archivo /etc/vmware/firewall/service.xml en una ubicacion persistente y realizar unas modificaciones al archivo /etc/rc.locald/local.sh para que cada vez que el ESXi inicie vuelva a reconfigurar las reglas personalizadas.

Para ello deberian copiar el archivo del backup a la ubicacion /etc/vmware/firewall/ y refrescar las reglas con el comando
esxcli network firewall refresh

Les dejo un ejemplo:

cp /vmfs/volumes/DiscoLocalESXi/bkpfiles/service.xml /etc/vmware/firewall
esxcli network firewall refresh

Espero que sea de ayuda...

Saludos,

Sanmarfe. VMware Certified Professional VCP3/VCP4/VCP5 VTSP4 / VTSP5 Si esta u otra respuesta es util, por favor marca su correspondiente notificador. Gracias/Regards
0 Kudos