Loading

×Sorry to interrupt
CSS Error

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Working with firewall rules in ESX 4.x (1021779)

Last Updated: 3/20/2024Categories: Total Views: 45007Language:
Portuguese (European)JapaneseEnglish

1 like this article

Subscribe to get an email
newsletter with new updates

1 people found this helpful Please provide article feedback:

Purpose

This article provides information about firewall rules in ESX 4.0 and ESX 4.1.

Resolution

VMware supports opening and closing firewall ports only through the vSphere Client or the esxcfg-firewall command. Using any other methods or scripts to open and close firewall ports can lead to unexpected behavior.

Use of iptables or other Linux commands to modify firewall default rules is not supported.

If you modify firewall rules for the ESX console by using the iptables or any command or utility other than the esxcfg-firewall command, accessing the service console through the firewall with any tools or utilities might cause the firewall to revert to its default configuration when your actions are complete. For example, configuring VMware High Availability (HA) on a host causes the firewall to revert to the default configuration specified by esxcfg-firewall if you have modified the rules by using the iptables command.

Opening and closing firewall ports with the esxcfg-firewall command

To open or close ports with the esxcfg-firewall command:

Log in to the service console and acquire root privileges.

Use this command to open the port:

esxcfg-firewall --openPort <port_number>,tcp|udp,in|out,<port_name>

Use this command to close the port:

esxcfg-firewall --closePort <port_number>,tcp|udp,in|out,<port_name>

Where:

<port_number</SPAN>> is the vendor-specified port number

tcp is for TCP traffic and udp is for UDP traffic

in opens the port for inbound traffic and out opens it for outbound traffic

<port_name> is a descriptive name to help identify the service or agent using the port. A unique name is not required.

For example:

#esxcfg-firewall --openPort 6380,tcp,in,Navisphere

#esxcfg-firewall --closePort 6380,tcp,in

Restart the vmware-hostd process. For more information, see Restarting the Management Agents on an ESX or ESXi Server (1003490).

Changing the default firewall rules by modifying default.xml

If you modify the defaults by using a Linux command, your changes are ignored and overwritten by the defaults specified for that service by the esxcfg-firewall command. If you want to change the defaults for a supported service, or define defaults for additional service types, you can modify or add to the rules in /etc/vmware/firewall/chains/default.xml. These rules follow the syntax of the iptables command. The default.xml file always uses the iptables-A option for the specified chain.

To change the default firewall rules using default.xml:

Log in to the service console with administrator privileges.

Edit the /etc/vmware/firewall/chains/default.xml file to correspond to your security policies.

Restart the service console firewall with the command:

service firewall restart

Check that the specified services are correctly enabled or disabled with the command:

esxcfg-firewall-e|d SERVICE

Verify that your modified rules are working correctly with the command:

iptables-nL

Note: Do not use the iptables command to modify any settings.

You can modify the firewall defaults for each of the service types according to your own security policies. For example, these rules in the /etc/vmware/firewall/chains/default.xml file determine the firewall rules for the INPUT chain:

<ConfigRoot>
<chain name="INPUT">
<rule>-p tcp --dport 80 -j ACCEPT</rule>
<rule>-p tcp --dport 110 -j ACCEPT</rule>
<rule>-p tcp --dport 25 -j ACCEPT</rule>
</chain>...
</ConfigRoot>

The default.xml fragment above is equivalent to these iptable commands:

% iptables -A INPUT -p tcp --dport 80 -j ACCEPT
% iptables -A INPUT -p tcp --dport 110 -j ACCEPT
% iptables -A INPUT -p tcp --dport 25 -j ACCEPT

Changes in ESX 4.1

ESX 4.1 introduces these additional configuration files located in /etc/vmware/firewall/chains:

usercustom.xml

userdefault.xml

The default files custom.xml and default.xml are overridden by usercustom.xml and userdefault.xml. All configuration is saved in usercustom.xml and userdefault.xml.

Copy the original custom.xml and default.xml files and use them as a template for usercustom.xml and userdefault.xml.

Related Information

Como trabalhar com regras de firewall no ESX 4.x
ESX 4.x でファイアウォール ルールを操作する

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
Portuguese (European)JapaneseEnglish

Attachments

Additional Resources

KB
•
End Of General Availability of the Free vSphere Hypervisor (ESXi 7.x and 8.x) (2107518)

KB
•
Network Dump Collector を介して、紫色の診断画面から VMkernel コアダンプを取得するように ESXi 5.x ホストを構成する (2002955)

KB
•
Download and Install VMware Fusion (2014097)

Results 1-3 of 3

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

VMware ESX Server

Related Versions:

VMware ESX 4.1.x

VMware ESX 4.0.x

Take Our Survey

Support Assistant