<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Citrix on vlan51</title><link>https://vlan51.com/tags/citrix/</link><description>Recent content in Citrix on vlan51</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Thu, 01 Oct 2015 00:00:00 +0000</lastBuildDate><atom:link href="https://vlan51.com/tags/citrix/index.xml" rel="self" type="application/rss+xml"/><item><title>Command-Line Packet Capture on Citrix NetScaler with nstrace</title><link>https://vlan51.com/netscaler/packet-capture-nstrace/</link><pubDate>Thu, 01 Oct 2015 00:00:00 +0000</pubDate><guid>https://vlan51.com/netscaler/packet-capture-nstrace/</guid><description>&lt;p&gt;How to capture packets on a Citrix NetScaler from the command line using &lt;code&gt;nstrace&lt;/code&gt;, then open the capture in Wireshark.&lt;/p&gt;&#10;&lt;h2 id="start-a-capture"&gt;Start a capture &lt;a class="anchor" href="#start-a-capture" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;SSH to the NetScaler and, at the &lt;code&gt;&amp;gt;&lt;/code&gt; prompt, run &lt;code&gt;nstrace&lt;/code&gt; with a filter:&lt;/p&gt;&#10;&lt;div class="code"&gt;&#10; &lt;div class="code-bar"&gt;&lt;span&gt;cli&lt;/span&gt;&lt;button class="copy" type="button" aria-label="Copy to clipboard"&gt;Copy&lt;/button&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;nstrace -filter &amp;#34;DESTIP == 10.0.0.20&amp;#34; -link ENABLED -size 0&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;&lt;code&gt;-size 0&lt;/code&gt; captures the entire packet. By default NetScaler only captures the headers.&lt;/p&gt;&#10;&lt;p&gt;To combine filters, put the whole expression in quotes and separate conditions with &lt;code&gt;||&lt;/code&gt; (or &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;):&lt;/p&gt;</description></item><item><title>Restricting SMTP Access with ACLs on Citrix NetScaler</title><link>https://vlan51.com/netscaler/acl-restrict-smtp/</link><pubDate>Thu, 01 Oct 2015 00:00:00 +0000</pubDate><guid>https://vlan51.com/netscaler/acl-restrict-smtp/</guid><description>&lt;p&gt;I had to configure a Citrix NetScaler (version 10.5) to load balance SMTP for an organisation that relayed mail through Microsoft&amp;rsquo;s smart host. Only specific source IP addresses should be able to reach port 25.&lt;/p&gt;&#10;&lt;p&gt;This is all done from the CLI. In the GUI, the same settings are under &lt;strong&gt;Configuration → System → Network → ACLs&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;In this example, the permitted senders are &lt;code&gt;1.1.1.1&lt;/code&gt; and &lt;code&gt;2.2.2.2&lt;/code&gt;.&lt;/p&gt;&#10;&lt;h2 id="create-the-acls"&gt;Create the ACLs &lt;a class="anchor" href="#create-the-acls" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;div class="code"&gt;&#10; &lt;div class="code-bar"&gt;&lt;span&gt;cli&lt;/span&gt;&lt;button class="copy" type="button" aria-label="Copy to clipboard"&gt;Copy&lt;/button&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;&amp;gt; add ns acl ALLOW-SMTP-1.1.1.1 ALLOW -srcIP = 1.1.1.1 -destPort = 25 -protocol TCP -priority 10&#10; Done&#10;&amp;gt; add ns acl ALLOW-SMTP-2.2.2.2 ALLOW -srcIP = 2.2.2.2 -destPort = 25 -protocol TCP -priority 20&#10; Done&#10;&amp;gt; add ns acl RESTRICT-SMTP-ALL DENY -srcIP = 0.0.0.0-* -destPort = 25 -protocol TCP -priority 50&#10; Done&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#10;&lt;p&gt;There&amp;rsquo;s no implicit deny or permit at the end of a NetScaler ACL list, so you need the explicit &lt;code&gt;DENY&lt;/code&gt; rule to block everyone else. Lower priority numbers are evaluated first.&lt;/p&gt;</description></item></channel></rss>