<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Computer Support &#187; TCP/IP</title>
	<atom:link href="http://www.xiitec.com/blog/tag/tcpip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configuring TCP/IP Filtering</title>
		<link>http://www.xiitec.com/blog/2008/02/15/configuring-tcpip-filtering/</link>
		<comments>http://www.xiitec.com/blog/2008/02/15/configuring-tcpip-filtering/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 23:38:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[TCP/IP]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=136</guid>
		<description><![CDATA[This filtering is applied to inbound traffic and does not affect outbound  traffic.

Using a graphical user interface

 Open the Control Panel.
From the Network Connections applet, open the connection you want to configure.
Click the Properties button.
Select Internet Protocol (TCP/IP).
Click the Properties button.
Click the Advanced button.
Click the Options tab.
Select TCP/IP filtering.
Click the Properties button.
Check the box [...]]]></description>
			<content:encoded><![CDATA[<p>This filtering is applied to inbound traffic and does not affect outbound  traffic.</p>
<p><span id="more-136"></span></p>
<p><strong>Using a graphical user interface</strong></p>
<ol>
<li> Open the Control Panel.</li>
<li>From the Network Connections applet, open the connection you want to configure.</li>
<li>Click the Properties button.</li>
<li>Select Internet Protocol (TCP/IP).</li>
<li>Click the Properties button.</li>
<li>Click the Advanced button.</li>
<li>Click the Options tab.</li>
<li>Select TCP/IP filtering.</li>
<li>Click the Properties button.</li>
<li>Check the box beside Enable TCP/IP Filtering.</li>
<li>Select Permit Only for TCP Ports, UDP Ports, and/or IP Protocols.</li>
<li>Click the Add button.</li>
<li>Enter the port or protocol number and click OK.</li>
<li>Repeat the last couple of steps until you&#8217;ve entered all desired ports and protocols.</li>
<li>After you are done, close all the dialog screens by clicking either OK or Close.</li>
<li>You will be prompted to reboot for the changes to take effect.</li>
</ol>
<p><strong>Using a command-line interface</strong></p>
<p>The following command enables TCP/IP filtering:</p>
<pre>&gt; reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /vEnableSecurityFilters /t REG_DWORD /d 1</pre>
<p>You must reboot for the changes to take effect. To disable  filtering, change <tt>/d</tt> <tt>1</tt> to <tt>/d</tt> <tt>0</tt>.</p>
<p>Next, configure the protocols and ports you want to filter.  This must be done on a per-interface basis. To configure this using the  registry, you need to know the GUID assigned to the interface you want to  modify. This is a sample interface entry:</p>
<pre>HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{07383FC4-FF4D-4E16-9DD6-C27061719D76}</pre>
<p>To find out what adapter that corresponds with, you can use  this command (on Windows Server 2003):</p>
<pre>&gt; wmic nicconfig get caption,settingid</pre>
<p>Once you know the GUID of the interface, you can use the  <tt>reg</tt> <tt>add</tt> command to modify the <tt>RawIPAllowedProtocols</tt>,  <tt>TCPAllowedPorts</tt>, or <tt>UDPAllowedPorts</tt> values to filter what you  want. Each of those values is of type REG_MULTI_SZ. Here is an example of  setting protocols 25 and 80:</p>
<pre>reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{07383FC4-FF4D-4E16-9DD6-C27061719D76} /v RawIPAllowedProtocols /t REG_MULTI_SZ /d 25\080</pre>
<p>You can also use the WMIC utility to configure TCP/IP  filtering. These two commands show you how:</p>
<pre>&gt; wmic /node:"<tt><em>&lt;ServerName&gt;</em></tt>" nicconfig call EnableIPFilterSec(1)&gt; wmic /node:"<tt><em>&lt;ServerName&gt;</em></tt>" nicconfig where ipenabled=True call EnableIPSec

(<tt><em>&lt;TCPPortList&gt;</em></tt>),(<tt><em>&lt;UDPPortList&gt;</em></tt>),(<tt><em>&lt;ProtoList&gt;</em></tt>)</pre>
<p>This command allows all TCP and UDP ports, but allows only  protocols 80 (http) and 25 (smtp):</p>
<pre>&gt; wmic nicconfig where ipenabled=True call EnableIPSec (80,25),(0),(0)</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code enables IP Filtering for all adapters and configures' filtering for all IP-enabled adapters.

' ------ SCRIPT CONFIGURATION ------

strComputer = "."

arrTCPPorts = Array ( 0 )       ' Allow all TCP ports

arrUDPPorts = Array ( 0 )       ' Allow all UDP ports

arrProtos   = Array ( 80, 25 )  ' Allow only HTTP and SMTP

' ------ END CONFIGURATION ---------

set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")

set objAdapterConfig = objWMI.Get("Win32_NetworkAdapterConfiguration")

intRC = objAdapterConfig.EnableIPFilterSec( True )

if intRC = 0 then

WScript.Echo "IP Filtering for all adapters enabled"

elseif intRC = 1 then

WScript.Echo "IP Filtering enabled for all adapters, " &amp; _

"but you must reboot for the changes to take effect"

else

WScript.Echo "There was an error enabling IP Filtering for all " &amp; _

"adapters: " &amp; intRC

end ifset colNAConfigs = objWMI.ExecQuery( _

"select * " &amp; _

" from Win32_NetworkAdapterConfiguration " &amp; _

" where IPEnabled = True" )

for each objNAConfig in colNAConfigs

intRC = objNAConfig.EnableIPSec( arrTCPPorts, arrUDPPorts, arrProtos )

if intRC = 0 then

WScript.Echo "IP Filtering configured for '" &amp; _

objNAConfig.Description &amp; "'"

elseif intRC = 1 then

WScript.Echo "IP Filtering configured for '" &amp; objNAConfig.Description &amp; _

"', but you must reboot for the changes to take effect"

else

WScript.Echo "There was an error configuring IP Filtering for '" &amp; _

objNAConfig.Description &amp; "': " &amp; intRC

end if

next</pre>
<p>Filtering by port or protocol can be useful in certain  situations, but be aware of the limitations. A good example of when you might  want to configure filtering is for external web servers. If your web server is  running on the default HTTP port (80) and it is running no other networked  application, then you only need port 80 open. But allowing only port 80 traffic  also prevents the server from acting as a member in an Active Directory domain  (which requires several ports to be open) and makes remote administration  difficult because you can&#8217;t connect using the Terminal Services client.  Obviously you can add these ports to the list you allow, but remember that if  you do port/protocol filtering, you must have the ports/protocols open that are  needed to support the machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/15/configuring-tcpip-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

