<?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>yurisk.info &#187; Solaris</title>
	<atom:link href="http://yurisk.info/category/solaris/feed/" rel="self" type="application/rss+xml" />
	<link>http://yurisk.info</link>
	<description>Yuri Slobodyanyuk&#039;s blog on IT Security and Networking</description>
	<lastBuildDate>Mon, 16 Apr 2012 17:23:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Grab bag of IPF commands for FreeBSD and Solaris 10</title>
		<link>http://yurisk.info/2010/11/14/grab-bag-of-ipf-commands-for-freebsd-and-solaris-10/</link>
		<comments>http://yurisk.info/2010/11/14/grab-bag-of-ipf-commands-for-freebsd-and-solaris-10/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 12:05:44 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1411</guid>
		<description><![CDATA[Nothing new here , just a round-up of the commands/configs I happen to need from time to time. Google probably has better references for that.I talk about Pf firewall used in FeeeBSD, OpenBSD and Solaris systems. Enable and disable firewall: #pfctl –e Enable packet filter real time #pfctl –ef /etc/pf.conf Enable packet filter and load [...]]]></description>
			<content:encoded><![CDATA[<p>Nothing new here , just a round-up of the commands/configs I happen to need from time to time. Google probably has better references for that.I talk about Pf firewall used in FeeeBSD, OpenBSD and Solaris systems. <br />
<strong>Enable and disable firewall:</strong></p>
<div class="cmd">
#pfctl –e    Enable packet filter real time <br />
#pfctl –ef  /etc/pf.conf     Enable packet filter and load rules from /etc/pf.conf<br />
#pfctl –d    Disable packet filter </div>
<p><strong>Enable/disable permanently to survive reboot </strong><br />
OpenBSD :</p>
<div class="cmdout">/etc/rc.conf.local: <br />
   pf=YES <br />
   pf_rules=/etc/pf.conf</div>
<p>FreeBSD:</p>
<div class="cmdout">/etc/default/rc.conf: <br />
   pf_enable=&#8221;YES&#8221;<br /> <br />
   pf_rules=&#8221;/etc/pf.conf&#8221; <br />
   pf_program=&#8221;/sbin/pfctl&#8221; <br />
   pflog_enable=&#8221;YES&#8221; <br />
   pflog_logfile=&#8221;/var/log/pflog&#8221;</div>
<p> <strong>Working with rules. </strong></p>
<div class="cmd">
 #pfctl –F all   Flush (remove) all the active rules from the running packet filter , means PERMIT ANY ANY.<br />
 #pfctl –n –f  /etc/pf.conf    just parse rules from file , not actually loading them, to check syntax<br />
 #pfctl  -f  /etc/pf.conf    Load rules from file</div>
<p>Order of rules in the file :<br />
options, normalization, queuing, translation, and  filtering rules.<br />
<strong>Show commands.</strong></p>
<div class="cmd"> #pfctl  –s info  Show filter information <br />
 #pfctl  -s  rules       Show the currently loaded filter rules <br />
 #pfctl  -s state       Show the contents of the state table. <br />
 #pfctl  -s all         Show all of the above</div>
<p> Simplest set of rules &#8211; block all the incoming but ssh, allow all the outgoing from the server.</p>
<div class="cmd">block in all <br />
pass out all keep state <br />
pass in   proto tcp from any to any port 22</div>
<p>It is just a beginning, to be continued later&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/11/14/grab-bag-of-ipf-commands-for-freebsd-and-solaris-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert mb4 to mp3 files in one run with ffmpeg</title>
		<link>http://yurisk.info/2010/10/23/convert-mb4-to-mp3-files-in-one-run-with-ffmpeg/</link>
		<comments>http://yurisk.info/2010/10/23/convert-mb4-to-mp3-files-in-one-run-with-ffmpeg/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 08:38:40 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=1348</guid>
		<description><![CDATA[Folks at Defcon.org have been somewhat inconsistent in publishing their conference audio archives &#8211; once they do it in mb4 format, once in mp3 . As I listen to them on my mobile phone during my commuting to the work  and it doesn&#8217;t accept anything but mp3 I had to first convert all audio files [...]]]></description>
			<content:encoded><![CDATA[<p>Folks at <a href="http://Defcon.org" target="_blank">Defcon.org </a> have been somewhat inconsistent in publishing their conference audio archives &#8211; once they do it in mb4 format, once in mp3 . As I listen to them on my mobile phone during my commuting to the work  and it doesn&#8217;t accept anything but mp3 I had to first convert all audio files from mb4 to mp3 format. Not a problem though, the one-liner below will find all files ending with .mb4 in the current folder and convert them to .mp3 files preserving the filenames.</p>
<div class="cmd"> find . -iname &#34;*.m4b&#34; -exec ffmpeg -i {} -acodec libmp3lame {}.mp3 \;</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/10/23/convert-mb4-to-mp3-files-in-one-run-with-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAC finder script</title>
		<link>http://yurisk.info/2010/07/02/mac-finder-script/</link>
		<comments>http://yurisk.info/2010/07/02/mac-finder-script/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 05:35:37 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Checkpoint NG/NGX]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Esafe]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Checkpoint]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=959</guid>
		<description><![CDATA[While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this [...]]]></description>
			<content:encoded><![CDATA[<p>While I don&#8217;t like going down to Layer 2 , recently I had to do it &#8211; I didn&#8217;t know IP address of the Cisco router I wanted to connect to but I had access to the Cisco router sitting in the same network. That would be pretty easy to do #show arp on this router and then search on Google to whom belongs each MAC  if it wasn&#8217;t the subnet mask of /26. Copy pasting each entry of the ARP table into Google didn&#8217;t look like a lot of fun. So I wrote a python script that reads MAC addresses in bulk from command line and using downloaded beforehand database of MAC-vendor translations prints vendor for each MAC address. It works for &#35;show arp on CIsco,&#35;show mac-address-table on CIsco switches, &#35;arp -en  on Linux (means including Checkpoint), &#35;arp -a on Freebsd ,&#35;show arp of Junos from Juniper, &#35;get sys arp on Fortigate.<br />
Below is the script.<br />
Here&#58;<br />
<strong>mac-database.txt</strong> &#8211; file containing MAC-vendor translation in format &lt;MAC 6 hex digits as a sequence&gt; &lt;VENDOR&gt;, I used <a href="http://standards.ieee.org/regauth/oui/oui.txt"> standards.ieee.org/regauth/oui/oui.txt </a> as the source with a bit of sed, but if you want ready to use file I recommend <strong>nmap-mac-prefixes</strong> from nmap source-code distribution <a href="http://nmap.org/svn/nmap-mac-prefixes">http://nmap.org/svn/nmap-mac-prefixes</a><br />
Download script (to make sure formatting is preserved, an important thing for Python)<br />
<a href="http://yurisk.info/scripts/mac-finder.py">http://yurisk.info/scripts/mac-finder.py</a><br />Script AND mac database from nmap project &#8211; <a href="http://yurisk.info/scripts/mac.tar.gz"> http://yurisk.info/scripts/mac.tar.gz</a></p>
<div class="cmdout">
<pre>
&#35;!/usr/bin/python
&#35;This script accepts MAC addresses from the command line and
&#35;prints vendor for each mac address
&#35; Author&#58;Yuri, yurisk@yurisk.info,06.2010
import sys
import re
&#35;This function removes from MACs colon or dot and returns MAC as a sequence of HEX chars
def dotreplace(matchobj):
&nbsp;&nbsp;       if matchobj.group(0) == &#39;.&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&nbsp;&nbsp;       elif  matchobj.group(0) == &#39;&#58;&#39;&#58;
&nbsp;&nbsp;&nbsp;&nbsp;            return &#39;&#39;
&#35;open file with MAC addresses and vendors database,it has form xxxx &lt;Vendor&gt;
macs=open(&#39;mac-database.txt&#39;,&#39;r&#39;)
macs_lines=macs.readlines()
&#35;Read from stdinput
data = sys.stdin.readlines()
for ppp in data:
       popa=re.search(&#39;.*([a-f0-9]{4}\.[a-f0-9]{4}\.[a-f0-9]{4}).*&#39;,ppp,re.IGNORECASE)
       if popa:
             newpopa=re.sub(&#39;\.&#39;, dotreplace,popa.group(1))[0:6]
             newpopa_re=re.compile(newpopa,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopa_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
       popalinux = re.search(&#39;.*([a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}&#58;[a-f0-9]{2}).*&#39;,ppp,re.IGNORECASE)
       if popalinux&#58;
             newpopalinux=re.sub(&#39;&#58;&#39;,dotreplace,popalinux.group(1))[0&#58;6]
             newpopalinux_re=re.compile(newpopalinux,re.IGNORECASE)
             for mac_db in macs_lines&#58;
                 vendor=re.search(newpopalinux_re,mac_db)
                 if vendor&#58;
                    print ppp.strip(),mac_db[7&#58;]

       popadash = re.search('.*([a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}-[a-f0-9]{2}).*',ppp,re.IGNORECASE)
       if popadash:
             newpopadash=re.sub('-',dotreplace,popadash.group(1))[0:6]
             newpopadash_re=re.compile(newpopadash,re.IGNORECASE)
             for mac_db in macs_lines:
                 vendor=re.search(newpopadash_re,mac_db)
                 if vendor:
                    print ppp.strip(),mac_db[7:]
</pre>
</div>
<p>Running it:</p>
<div class="cmd">
[root@darkstar ]# ./mac-finder.py</div>
<div class="cmdout">
&lt;now I copy paste output from arp -a in BSD&gt;<br />$ arp -a<br />
(10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet]<br />
 (10.99.99.254) at 00:09:0f:31:c8:24  on em0 [ethernet]<br /> &lt;Hit CTRL+D to signal the end of input&gt;<br />
 (10.99.99.150) at 00:50:56:95:74:72 on em0 [ethernet] VMware, Inc.<br />
 (10.99.99.254) at 00:09:0f:31:c8:24 on em0 [ethernet] Fortinet Inc.</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/07/02/mac-finder-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Solaris interfaces – create assign delete</title>
		<link>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/</link>
		<comments>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 18:27:10 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=891</guid>
		<description><![CDATA[Working with interfaces in Solaris is pretty much the same as in Linux &#8211; you&#8217;ve got ifconfig, netstat,route. It looks in outputs a bit different but if you&#8217;re used to the *BSD way of things you&#8217;ll find yourself at home. So the most basic thing follows &#8211; bring interface up, assign ipv4 address, save the [...]]]></description>
			<content:encoded><![CDATA[<p>Working with interfaces in Solaris is pretty much the same as in Linux &#8211; you&#8217;ve got <strong>ifconfig, netstat,route</strong>. It looks in outputs a bit different but if you&#8217;re used to the *BSD way of things you&#8217;ll find yourself at home. So the most basic thing follows &#8211; bring interface up, assign ipv4 address, save the change to survive reboot.<br />
<strong>Plumb.</strong> First step sounds a bit strange &#8211; plumbing, but is actually very simple (no need to call for Mario) . You just plumb the interface (I talk about Ethernet-type interfaces) to the IP stack.<br />
- Interface before plumbing &#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">ifconfig&#58; status&#58; SIOCGLIFFLAGS&#58; e1000g2&#58; no such interface</div>
<p>Even an unplumbed interface can be seen with&#58;</p>
<div class="cmd">bash-3.00# dladm show-link</div>
<div class="cmdout">e1000g0         type: non-vlan  mtu: 1500       device&#58; e1000g0<br />
e1000g1         type&#58; non-vlan  mtu&#58; 1500       device&#58; e1000g1<br />
e1000g2         type&#58; non-vlan  mtu&#58; 1500       device&#58; e1000g2</div>
<p>- Now plumbing&#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g2 plumb<br />
bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">e1000g2&#58; flags=1000842&lt;BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 4<br />
        inet 0.0.0.0 netmask 0<br />
        ether 00&#58;E0&#58;9F&#58;67&#58;98&#58;fb</div>
<p><strong> Assing IP and bring it up.</strong> This one is well known.</p>
<div class="cmd">bash-3.00# ifconfig e1000g2 inet 192.2.2.3/24 up<br />
bash-3.00# ifconfig e1000g2</div>
<div class="cmdout">e1000g2: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 4<br />  inet 192.2.2.3 netmask ffffff00 broadcast 192.2.2.255<br />
        ether 00&#58;E0&#58;9F&#58;67&#58;98&#58;fb</div>
<p><strong> Make this change permanent</strong><br /> So far so good. But if you do restart to the machine now it will lose its interface settings. To save them you create a text file named /etc/hostname.&lt;interface name&gt;  In my case it will be <strong>/etc/hostname.e1000g2</strong> , this alone would plumb interface on start, and now put the IP address inside it in the form &#8217;192.2.2.3/24&#8242; . That is it.</p>
<p>To see if interface is up or down as a device and its duplex/speed parameters&#58;</p>
<div class="cmd">bash-3.00# dladm show-dev</div>
<div class="cmdout">e1000g0         link: up        speed: 1000  Mbps       duplex: full<br />
e1000g1         link&#58; up        speed&#58; 1000  Mbps       duplex&#58; full<br />
e1000g2         link&#58; up        speed&#58; 1000  Mbps       duplex&#58; full</div>
<p><strong> Create/delete logical interface</strong> In Cisco world you would call it assigning secondary ip to the interface. </p>
<div class="cmd">bash-3.00# ifconfig e1000g1 addif 193.92.13.3/24</div>
<p>Created new logical interface e1000g1&#58;1</p>
<div class="cmd">bash-3.00# ifconfig e1000g1&#58;1 up</div>
<div class="cmdout">bash-3.00# ifconfig e1000g1&#58;1<br />
e1000g1:1: flags=1000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4&gt; mtu 1500 index 3 <br />
inet 193.92.13.3 netmask ffffff00 broadcast 193.92.13.255 </div>
<p>Remove logical interface&#58;</p>
<div class="cmd">bash-3.00# ifconfig e1000g1 removeif 193.92.13.3<br />
bash-3.00# ifconfig e1000g1&#58;1</div>
<div class="cmdout">ifconfig&#58; status&#58; SIOCGLIFFLAGS&#58; e1000g1&#58;1&#58; no such interface</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/06/16/solaris-interfaces-create-assign-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure VLAN Solaris way</title>
		<link>http://yurisk.info/2010/05/16/configure-vlan-solaris-way/</link>
		<comments>http://yurisk.info/2010/05/16/configure-vlan-solaris-way/#comments</comments>
		<pubDate>Sun, 16 May 2010 17:28:58 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=801</guid>
		<description><![CDATA[To create VLAN in Solaris you have to first decide where the Physical Point of Attachment (PPA) will be. In other words you have to attach VLAN to some physical interface on the server , as of now interface types that support VLANs are: ce bge xge e1000g After you decided on the PPA and [...]]]></description>
			<content:encoded><![CDATA[<p>To create VLAN in Solaris you have to first decide where the Physical Point of Attachment (PPA)  will be. In other words you have to attach VLAN to some physical interface on the server , as of now interface types that support VLANs are:<br />
ce<br />
bge<br />
xge<br />
e1000g<br />
After you decided on the PPA and the VLAN ID using this formula the whole name for the new VLAN interface is calculated:</p>
<div class="portant">VLAN int name = physical interface driver name + VLAN ID *1000 + physical device instance</div>
<p>In my case creating vlan 777 attached to the physical interface e1000g0 yields this:</p>
<div class="cmd">Int name = e1000g + 777*1000 + 0  = e1000g777000</div>
<p>Usual plumbing and IP assigning to do:</p>
<div class="cmd">Solaris_star# ifconfig e1000g777000 plumb<br />
Solaris_star# ifconfig e1000g777000 inet 10.11.11.2/24<br />
Solaris_star# ifconfig e1000g777000 up</div>
<p>Verify:</p>
<div class="cmd">Solaris_star# dladm show-link</div>
<div class="cmdout">e1000g0         type: non-vlan  mtu: 1500       device: e1000g0<br />
e1000g777000    type: vlan 777  mtu: 1500       device: e1000g0<br />
e1000g1         type: non-vlan  mtu: 1500       device: e1000g1<br />
e1000g2         type: non-vlan  mtu: 1500       device: e1000g2</div>
<div class="cmd">Solaris_star# ifconfig e1000g777000</div>
<div class="cmdout">e1000g777000: flags=201000843&lt;UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS&gt; mtu 1500 index 4<br />
        inet 10.11.11.2 netmask ffffff00 broadcast 10.11.11.255<br />
        ether 0:c:29:67:98:e7</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/05/16/configure-vlan-solaris-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>md5 and sha1 hashing in Solaris</title>
		<link>http://yurisk.info/2010/05/15/md5-and-sha1-hashing-in-solaris/</link>
		<comments>http://yurisk.info/2010/05/15/md5-and-sha1-hashing-in-solaris/#comments</comments>
		<pubDate>Sat, 15 May 2010 10:57:38 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=763</guid>
		<description><![CDATA[How do you calculate md5 hash ? md5sum of course, I thought ,coming from the Linux world and was wrong. In Solaris , again, all that comes from open source projects is add-at-your-own-risk paradigm. Instead the native crypto provider supplies hash calculations with digest command: # digest -l sha1 md5 sha256 sha384 sha512 Solaris_star# digest [...]]]></description>
			<content:encoded><![CDATA[<p>How do you calculate md5 hash ? md5sum of course, I thought ,coming from the Linux world and was wrong. In Solaris , again, all that comes from open source projects is add-at-your-own-risk paradigm. Instead the native crypto provider supplies hash calculations with <strong> digest</strong> command:</p>
<div class="cmd"># digest -l</div>
<div class="cmdout">
sha1<br />
md5<br />
sha256<br />
sha384<br />
sha512</div>
<div class="cmd">Solaris_star# digest -v -a md5 sntp.py</div>
<div class="cmdout">
md5 (sntp.py) = 0e306d35ef7da1a47c51590fe70b3144</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/05/15/md5-and-sha1-hashing-in-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypting local files in Solaris</title>
		<link>http://yurisk.info/2010/05/15/encrypting-local-files-in-solaris/</link>
		<comments>http://yurisk.info/2010/05/15/encrypting-local-files-in-solaris/#comments</comments>
		<pubDate>Sat, 15 May 2010 10:36:59 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=757</guid>
		<description><![CDATA[How do I encrypt local file in Solaris ? On Linux I use either OpenSSL or GPG but these are both open source projects not native in Solaris land. For this Solaris has encrypt/decrypt which do what their name say. And of course we talk here about symmetric encryption. Options for encrypt/decrypt are succinct – [...]]]></description>
			<content:encoded><![CDATA[<p>How do I encrypt local file in Solaris ? On Linux I use either OpenSSL or GPG but these are both open source projects not native in Solaris land. For this Solaris has encrypt/decrypt which do what their name say.<br />
And of course we talk here about symmetric encryption. Options for encrypt/decrypt are succinct – list available algorithms, specify input/output file(s), and optional specify file containing the key or otherwise type it on terminal.  Few examples are to follow.<br />
 &#8211; List algos</p>
<div class="cmd"># encrypt –l </div>
<div class="cmdout">
Algorithm       Keysize:  Min   Max (bits)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
aes                       128   256<br />
arcfour                     8  2048<br />
des                        64    64<br />
3des                      192   192</div>
<p>- Now let’s encrypt something (file smtp_send.py ) with AES algo .</p>
<div class="cmd"># encrypt -a aes -i smtp_send.py -o smtp_send.py.enc<br />
Enter key: </div>
<div class="cmdout">
Solaris#</div>
<div class="cmd"> Solaris# file smtp_send.py.enc</div>
<div class="cmdout"> smtp_send.py.enc:       data</div>
<p>- And what about decrypting ?</p>
<div class="cmd"> # decrypt -a aes -i smtp_send.py.enc -o smtp_send.py.dec<br />
Enter key: </div>
<p>- In case you wish to use key stored in a file (I personally don’t do it as it is too easy to forget to delete the key file). </p>
<div class="cmd"> # encrypt -a aes –k key_in_a_file.txt -i smtp_send.py -o smtp_send.py.enc</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/05/15/encrypting-local-files-in-solaris/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Solaris – configure ftp server</title>
		<link>http://yurisk.info/2010/03/31/solaris-configure-ftp-server/</link>
		<comments>http://yurisk.info/2010/03/31/solaris-configure-ftp-server/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 09:58:32 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=654</guid>
		<description><![CDATA[SUN Solaris FTP SUN Solaris comes with ftp daemon based on WU-FTPd Washington University project. While not being very enthusiastic about its vulnerabilities discovered over the years and being rather abandoned by its developers ,still it comes by default and as long as Sun ok with that it is ok with me too. Below I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>SUN Solaris FTP</strong><br />
SUN Solaris comes with ftp daemon based on  WU-FTPd Washington University project.<br />
While not being very enthusiastic about its vulnerabilities discovered over the years and being rather<br />
abandoned by its developers ,still it comes by default and as long as Sun ok with that it is ok with me too.<br />
Below I will shortly introduce configuring it for local user access as well as anonymous one.<br />
<br />By default FTP daemon (<strong>in.ftpd</strong>) is disabled. Here is the initial state you have it :</p>
<div class="cmd">root@Solaris# svcs ftp</div>
<div class="cmdout">STATE          STIME    FMRI<br />
disabled        7:21:44 svc:/network/ftp:default</div>
<p>As ftpd is inet managed daemon more information can be queried from inetadm:</p>
<div class="cmd">root@Solaris# inetadm -l svc:/network/ftp:default</div>
<div class="cmdout">SCOPE    NAME=VALUE<br />
         name=&#8221;ftp&#8221;<br />
         endpoint_type=&#8221;stream&#8221;<br />
         proto=&#8221;tcp6&#8243;<br />
         isrpc=FALSE<br />
         wait=FALSE<br />
         exec=&#8221;/usr/sbin/in.ftpd -a&#8221;<br />
         user=&#8221;root&#8221;<br />
default  bind_addr=&#8221;"<br />
default  bind_fail_max=-1<br />
default  bind_fail_interval=-1<br />
default  max_con_rate=-1<br />
default  max_copies=-1<br />
default  con_rate_offline=-1<br />
default  failrate_cnt=40<br />
default  failrate_interval=60<br />
default  inherit_env=TRUE<br />
default  tcp_trace=FALSE<br />
default  tcp_wrappers=FALSE<br />
default  connection_backlog=10</div>
<p>Insecure  you say , well , you are right – let’s sharpen it a bit.<br />
Enable more detailed logging.</p>
<div class="cmd">root@Solaris# inetadm -m svc:/network/ftp:default tcp_trace=TRUE<br />
root@Solaris# inetadm -l svc:/network/ftp</div>
<div class="cmdout">SCOPE    NAME=VALUE<br />
         name=&#8221;ftp&#8221;<br />
         endpoint_type=&#8221;stream&#8221;<br />
         proto=&#8221;tcp6&#8243;<br />
         isrpc=FALSE<br />
         wait=FALSE<br />
         exec=&#8221;/usr/sbin/in.ftpd -a&#8221;<br />
         user=&#8221;root&#8221;<br />
default  bind_addr=&#8221;"<br />
default  bind_fail_max=-1<br />
default  bind_fail_interval=-1<br />
default  max_con_rate=-1<br />
default  max_copies=-1<br />
default  con_rate_offline=-1<br />
default  failrate_cnt=40<br />
default  failrate_interval=60<br />
default  inherit_env=TRUE<br />
         tcp_trace=TRUE<br />
default  tcp_wrappers=FALSE<br />
default  connection_backlog=10</div>
<p>When execution option –a is given (and it is by default) then ftpd will consult /etc/ftpd/ftpaccess<br />
file for additional restrictions and tweaks. Here are the few that are worth enabling.<br />
Uncomment following lines to have more verbose logging available:</p>
<div class="cmdout">
log            transfers       real,guest,anonymous    inbound,outbound<br />
xferlog        format  %T %Xt %R %Xn %XP %Xy %Xf %Xd %Xm %U ftp %Xa %u %Xc %Xs %Xr</div>
<p>Make sure these changes are applied </p>
<div class="cmd">root@Solaris# svcadm refresh svc:/network/ftp:default</div>
<p><u>Configure anonymous access. </u><br />
All the configs so far will allow only local valid users to connect by ftp and be automatically<br />
placed in their respective home directories. To allow anonymous ftp access with dedicated chrooted for that folder there is a special set of tools to use. Actually it is just one script that does all the hard work behind the scenes – creates ftp user, creates directory tree , sets up needed permissions, sets up chrooted environment for the anonymous ftp user.</p>
<div class="cmd">root@Solaris# ftpconfig /export/home/ftp_pub</div>
<div class="cmdout">Updating user ftp<br />
Creating directory /export/home/ftp_pub<br />
Updating directory /export/home/ftp_pub</div>
<p>That is all, now you can login anonymously and download anything from /export/home/ftp_pub/pub directory. To also allow upload there , change the  upload option in &#8220;/etc/ftpd/ftpaccess&#8221; and set accordingly permissions on the Solaris level for the directory pub (777)</p>
<div class="cmdout">
upload          class=anonusers    *    /pub      yes<br />
#upload         class=anonusers    *    *         no  nodirs</div>
<p>And finally enable it</p>
<div class="cmd">root@Solaris# svcadm enable ftp</div>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2010/03/31/solaris-configure-ftp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ping – setting don&#8217;t fragment bit in Linux/FreeBSD/Solaris/Cisco/Juniper</title>
		<link>http://yurisk.info/2009/09/01/ping-setting-dont-fragment-bit-in-linuxfreebsdsolarisciscojuniper/</link>
		<comments>http://yurisk.info/2009/09/01/ping-setting-dont-fragment-bit-in-linuxfreebsdsolarisciscojuniper/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 08:42:46 +0000</pubDate>
		<dc:creator>Yuri</dc:creator>
				<category><![CDATA[Awk weekly]]></category>
		<category><![CDATA[Cisco]]></category>
		<category><![CDATA[Fortigate]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[awk weekly]]></category>

		<guid isPermaLink="false">http://yurisk.info/?p=201</guid>
		<description><![CDATA[Ping. Many times while debugging network problems of various kinds you need to send some packets of desirable size  and don’t fragment bit being set. Below I list how to do it for  the different equipment/OSes. Let’s start with the  most popular operating system among network folks – Linux: Linux By default ping in any [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Ping.</strong></p>
<p>Many times while debugging network problems of various kinds you need to send some packets<br />
of desirable size  and don’t fragment bit being set. Below I list how to do it for  the different<br />
equipment/OSes.<br />
Let’s start with the  most popular operating system among network folks – Linux:</p>
<p><strong><span style="text-decoration: underline;">Linux</span></strong></p>
<p>By default ping in any Linux-based system (It also means any distribution – Slackware, Ubuntu, CentOS etc) is sent with<br />
Don’t fragment (df) bit set . You don’t need to add any command line switches for that.<br />
Here is what you get by default ping in Linux:<br />
Defaults:<br />
Don’t fragment bit  (in echo request)  &#8211; set<br />
Ip packet size – 84 bytes<br />
Sending interval  &#8211; 1 second</p>
<p>Some examples.<br />
- sending pings station:<br />
[root@lonestar ~]# ping 191.91.21.41<br />
-   receiving station:<br />
[root@darkstar ~]# tcpdump -s 1500 -n -vv icmp<br />
21:23:51.598641 IP (tos 0&#215;0, ttl  61, id 20, offset 0, <span style="color: #0000ff;">flags [DF]</span>, proto: ICMP (1), length: <span style="color: #0000ff;">84</span>) 112.225.125.100 &gt; 10.99.99.150: ICMP echo request, id 5392, seq 20, length 64<br />
21:23:51.598817 IP (tos 0&#215;0, ttl  64, id 7135, offset 0, flags [none], proto: ICMP (1), length: 84) 10.99.99.150 &gt; 112.225.125.100: ICMP echo reply, id 5392, seq 20, length 64<br />
To change sent packet size:<br />
<strong> -s  &lt;size&gt; , bytes</strong> (8 bytes of ICMP header will be added automatically).</p>
<p>Sending host:<br />
[root@darkstar ~]# ping 10.99.99.158 -s 1300<br />
PING 10.99.99.158 (10.99.99.158) 1300(1328) bytes of data.<br />
1308 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=1.65 ms</p>
<p>Receiving host:<br />
freeBSD# tcpdump -n -v -s 1500 icmp<br />
16:15:11.901787 IP (tos 0&#215;0, ttl 64, id 0, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto ICMP (1), length <span style="color: #0000ff;">1328</span>) 10.99.99.150 &gt; 10.99.99.158: ICMP echo request, id 44399, seq 63, length 1308<br />
To change sending interval (mostly used together with large packet size) :<br />
<strong>-i  &lt;secs&gt;</strong></p>
<p>Sending host:<br />
[root@darkstar ~]# ping -s 1300 -i 0.2 10.99.99.158</p>
<p>Receiving host:<br />
freeBSD# tcpdump -n -v -s 1500 icmp<br />
16:20:11.223481 IP (tos 0&#215;0, ttl 64, id 0, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto ICMP (1), length <span style="color: #0000ff;">1328</span>) 10.99.99.150 &gt; 10.99.99.158: ICMP echo request, id 1136, seq 396, length 1308<br />
16:20:11.223496 IP (tos 0&#215;0, ttl 64, id 805, offset 0, flags [DF], proto ICMP (1), length 1328) 10.99.99.158 &gt; 10.99.99.150: ICMP echo reply, id 1136, seq 396, length 1308</p>
<p>To force Linux to send pings with DF bit cleared (i.e. not set):<br />
<strong>ping –M don’t</strong></p>
<p>Sending host:</p>
<p>[root@darkstar ~]# ping -s 1300 -M dont  10.99.99.158<br />
PING 10.99.99.158 (10.99.99.158) 1300(1328) bytes of data.<br />
1308 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=0.560 ms</p>
<p>Receiving host:</p>
<p>freeBSD# tcpdump -n -v -s 1500 icmp<br />
16:28:33.111903 IP (tos 0&#215;0, ttl 64, id 41857, offset 0, <span style="color: #0000ff;">flags [none],</span> proto ICMP (1), length 1328) 10.99.99.150 &gt; 10.99.99.158: ICMP echo request, id 33136, seq 6, length 1308<br />
16:28:33.111920 IP (tos 0&#215;0, ttl 64, id 9425, offset 0, flags [none], proto ICMP (1), length 1328) 10.99.99.158 &gt; 10.99.99.150: ICMP echo reply, id 33136, seq 6, length 1308</p>
<p><strong>SideNote:</strong> FreeBSD ping has a nice add-on (see below) – sweeping size of the packets, while Linux doesn’t have such extra feature,<br />
Below is script to emulate it on Linux:<br />
awk  &#8216; BEGIN  {for (size=100;size&lt;1470;size++)  {<br />
cmd = (&#8220;ping –c 3 –I 0.5 –s  &#8221; size  &#8220;  &#8220;  &#8220;10.99.99.158&#8243;)<br />
print cmd | &#8220;/bin/bash&#8221;<br />
close(&#8220;/bin/bash&#8221;)  } } &#8216;</p>
<p>Here:<br />
<em> size</em> – size of data in ICMP packet (bytes);<br />
<em>-I 0.5</em> – interval of 5 seconds (optional);<br />
<em>-c 3</em> &#8211; number of pings in each size session (NOT optional – or you will enter an endless loop which even Ctrl-C won’t be able<br />
to stop )</p>
<p>See it in action:<br />
[root@darkstar ~]# awk  &#8216; BEGIN  {for (size=100;size&lt;1470;size++)  {<br />
cmd = (&#8220;ping -c 3 -i 0.5 -s  &#8221; size  &#8220;  &#8220;  &#8220;10.99.99.158&#8243;)<br />
print cmd | &#8220;/bin/bash&#8221;<br />
close(&#8220;/bin/bash&#8221;)  } } &#8216;<br />
PING 10.99.99.158 (10.99.99.158) 100(128) bytes of data.<br />
108 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=1.75 ms<br />
108 bytes from 10.99.99.158: icmp_seq=2 ttl=64 time=0.276 ms<br />
108 bytes from 10.99.99.158: icmp_seq=3 ttl=64 time=0.201 ms</p>
<p>&#8212; 10.99.99.158 ping statistics &#8212;<br />
3 packets transmitted, 3 received, 0% packet loss, time 1002ms<br />
rtt min/avg/max/mdev = 0.201/0.742/1.750/0.713 ms<br />
PING 10.99.99.158 (10.99.99.158) 101(129) bytes of data.<br />
109 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=0.185 ms<br />
109 bytes from 10.99.99.158: icmp_seq=2 ttl=64 time=0.253 ms<br />
109 bytes from 10.99.99.158: icmp_seq=3 ttl=64 time=0.230 ms</p>
<p>&#8212; 10.99.99.158 ping statistics &#8212;<br />
3 packets transmitted, 3 received, 0% packet loss, time 1000ms<br />
rtt min/avg/max/mdev = 0.185/0.222/0.253/0.033 ms<br />
PING 10.99.99.158 (10.99.99.158) 102(130) bytes of data.<br />
110 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=0.118 ms<br />
110 bytes from 10.99.99.158: icmp_seq=2 ttl=64 time=0.201 ms<br />
110 bytes from 10.99.99.158: icmp_seq=3 ttl=64 time=0.343 ms</p>
<p>&#8212; 10.99.99.158 ping statistics &#8212;<br />
3 packets transmitted, 3 received, 0% packet loss, time 1001ms<br />
rtt min/avg/max/mdev = 0.118/0.220/0.343/0.094 ms<br />
PING 10.99.99.158 (10.99.99.158) 103(131) bytes of data.<br />
111 bytes from 10.99.99.158: icmp_seq=1 ttl=64 time=0.565 ms<br />
111 bytes from 10.99.99.158: icmp_seq=2 ttl=64 time=0.182 ms<br />
111 bytes from 10.99.99.158: icmp_seq=3 ttl=64 time=0.329 ms<br />
<strong><span style="text-decoration: underline;">FreeBSD</span></strong></p>
<p>Defaults:<br />
Don’t fragment bit &#8211; not set   ; use –D  option to set<br />
IP Packet size:  84 bytes  ;  use –s option to change<br />
Sending interval:  1 sec  ;   use  –I  &lt;secs&gt; to change<br />
e.g. Sending pings  of data size 1300 bytes with interval 0.2 seconds with df bit set:</p>
<p>Sending host[10.99.99.158]:<br />
freeBSD# ping -D -s 1300 -i 0.2 10.99.99.150</p>
<p>Receiving host[10.99.99.150]:<br />
[root@darkstar ~]# tcpdump -n -v -s 1500  host 10.99.99.158<br />
20:42:57.816697 IP (tos 0&#215;0, ttl  64, id 11630, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">1328</span>) 10.99.99.158 &gt; 10.99.99.150: ICMP echo request, id 10770, seq 23, length 1308<br />
20:42:57.816914 IP (tos 0&#215;0, ttl  64, id 33327, offset 0, flags [none], proto: ICMP (1), length: 1328) 10.99.99.150 &gt; 10.99.99.158: ICMP echo reply, id 10770, seq 23, length 1308</p>
<p><strong>SideNote:</strong> *BSD family  has  a nice additional option  not found in most other systems  – you can  order ping to sweep size of sent packets .<br />
Example follows:</p>
<p>Here sweep range is from 20 bytes up to 1400 bytes, increase step is 300 bytes.</p>
<p>Sending host[10.99.99.158]:<br />
freeBSD# ping -D <span style="color: #0000ff;">-<span style="color: #0000ff;">g 20 -G 1400</span></span><span style="color: #0000ff;"> -h 300</span> 10.99.99.150<br />
PING 10.99.99.150 (10.99.99.150): (20 &#8230; 1400) data bytes<br />
28 bytes from 10.99.99.150: icmp_seq=0 ttl=64 time=1.313 ms<br />
328 bytes from 10.99.99.150: icmp_seq=1 ttl=64 time=0.531 ms<br />
628 bytes from 10.99.99.150: icmp_seq=2 ttl=64 time=0.581 ms<br />
928 bytes from 10.99.99.150: icmp_seq=3 ttl=64 time=0.362 ms<br />
1228 bytes from 10.99.99.150: icmp_seq=4 ttl=64 time=0.223 ms</p>
<p>&#8212; 10.99.99.150 ping statistics &#8212;<br />
5 packets transmitted, 5 packets received, 0.0% packet loss<br />
round-trip min/avg/max/stddev = 0.223/0.602/1.313/0.377 ms<br />
Receiving host[10.99.99.150]:<br />
[root@darkstar ~]# tcpdump -n -v -s 1500  host 10.99.99.158<br />
21:50:06.942165 IP (tos 0&#215;0, ttl  10.99.99.150 64, id 12828, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">48</span>) 10.99.99.158 &gt; 10.99.99.150: ICMP echo request, id 50962, seq 0, length 28<br />
21:50:06.944098 IP (tos 0&#215;0, ttl  64, id 43255, offset 0, flags [none], proto: ICMP (1), length: 48) 10.99.99.150 &gt; 10.99.99.158: ICMP echo reply, id 50962, seq 0, length 28<br />
21:50:07.944761 IP (tos 0&#215;0, ttl  64, id 12831, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">348</span>) 10.99.99.158 &gt; 10.99.99.150: ICMP echo request, id 50962, seq 1, length 328<br />
21:50:07.944826 IP (tos 0&#215;0, ttl  64, id 43256, offset 0, flags [none], proto: ICMP (1), length: 348) 10.99.99.150 &gt; 10.99.99.158: ICMP echo reply, id 50962, seq 1, length 328<br />
21:50:08.945815 IP (tos 0&#215;0, ttl  64, id 12833, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">648</span>) 10.99.99.158 &gt; 10.99.99.150: ICMP echo request, id 50962, seq 2, length 628<br />
21:50:08.945890 IP (tos 0&#215;0, ttl  64, id 43257, offset 0, flags [none], proto: ICMP (1), length: 648) 10.99.99.150 &gt; 10.99.99.158: ICMP echo reply, id 50962, seq 2, length 628<br />
21:50:09.946724 IP (tos 0&#215;0, ttl  64, id 12835, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">948</span>) 10.99.99.158 &gt; 10.99.99.150: ICMP echo request, id 50962, seq 3, length 928<br />
21:50:09.946819 IP (tos 0&#215;0, ttl  64, id 43258, offset 0, flags [none], proto: ICMP (1), length: 948) 10.99.99.150 &gt; 10.99.99.158: ICMP echo reply, id 50962, seq 3, length 928</p>
<p><strong><span style="text-decoration: underline;">SOLARIS</span></strong><br />
Defaults:<br />
Don’t fragment bit    - <span style="text-decoration: underline;"> not set</span> , and not changeable , yes , it sounds strange but Solaris doesn’t<br />
support  df bit in its ping utility. You may set df bit in their traceroute program , but it has no provision for changing size of the packet and therefore is of no value for our case.</p>
<p>Non-verbose ; use –s to override<br />
IP packet size:  84 bytes</p>
<p>Pinging with defaults:<br />
<a href="mailto:root@opensolaris">root@solaris</a>:~# ping -s 10.99.99.150<br />
PING 10.99.99.150: 56 data bytes<br />
64 bytes from 10.99.99.150: icmp_seq=0. time=0.759 ms</p>
<p>Receiving host:<br />
[root@darkstar ~]# tcpdump -n -v -s 1500  host 10.99.99.159<br />
20:50:08.084364 IP (tos 0&#215;0, ttl 255, id 8020, offset 0, <span style="color: #0000ff;">flags [none],</span> proto: ICMP (1), length: <span style="color: #0000ff;">84</span>) 10.99.99.159 &gt; 10.99.99.150: ICMP echo request, id 9096, seq 7, length 64<br />
20:50:08.084538 IP (tos 0&#215;0, ttl  64, id 52389, offset 0, flags [none], proto: ICMP (1), length: 84) 10.99.99.150 &gt; 10.99.99.159: ICMP echo reply, id 9096, seq 7, length 64</p>
<p>To change size of sent packet, to say 1300 bytes of data:</p>
<p><a href="mailto:root@opensolaris">root@solaris</a>:~# ping -s 10.99.99.150  <span style="color: #0000ff;">1320</span><br />
PING 10.99.99.150: 1320 data bytes<br />
1328 bytes from 10.99.99.150: icmp_seq=0. time=1.610 ms<br />
1328 bytes from 10.99.99.150: icmp_seq=1. time=0.335 ms<br />
<strong>SideNote:</strong> There is no size sweeping capability built-in , so I wrote  this script to   emulate this feature  in Solaris as well:<br />
<a href="mailto:root@opensolaris">root@solaris</a>:~# awk  &#8216; BEGIN  {for (size=100;size&lt;1470;size=size+10)  {<br />
cmd = (&#8220;ping   -s &#8220;    &#8220;10.99.99.158 &#8221; size  &#8221; 3&#8243;)<br />
print cmd | &#8220;/bin/bash&#8221;<br />
close(&#8220;/bin/bash&#8221;)  } } &#8216;</p>
<p>Here :<br />
<em>size </em> -  size of date in ICMP packet , starts at 10 bytes ends at 170 bytes<br />
<em>size+10</em> – size incrementing by 10 bytes each series of pings<br />
<em>3</em> &#8211; number of pings in each size set.</p>
<p>Results:<br />
<a href="mailto:root@opensolaris">root@solaris</a>:~# awk  &#8216; BEGIN  {for (size=100;size&lt;1470;size=size+10)  {<br />
cmd = (&#8220;ping   -s &#8220;    &#8220;10.99.99.158 &#8221; size  &#8221; 3&#8243;)<br />
print cmd | &#8220;/bin/bash&#8221;<br />
close(&#8220;/bin/bash&#8221;)  } } &#8216;<br />
PING 10.99.99.158: 100 data bytes<br />
108 bytes from 10.99.99.158: icmp_seq=0. time=0.319 ms<br />
108 bytes from 10.99.99.158: icmp_seq=1. time=0.460 ms<br />
108 bytes from 10.99.99.158: icmp_seq=2. time=0.328 ms</p>
<p>&#8212;-10.99.99.158 PING Statistics&#8212;-<br />
3 packets transmitted, 3 packets received, 0% packet loss<br />
round-trip (ms)  min/avg/max/stddev = 0.319/0.369/0.460/0.079<br />
PING 10.99.99.158: 110 data bytes<br />
118 bytes from 10.99.99.158: icmp_seq=0. time=0.371 ms<br />
118 bytes from 10.99.99.158: icmp_seq=1. time=0.370 ms<br />
118 bytes from 10.99.99.158: icmp_seq=2. time=0.477 ms</p>
<p>&#8212;-10.99.99.158 PING Statistics&#8212;-<br />
3 packets transmitted, 3 packets received, 0% packet loss<br />
round-trip (ms)  min/avg/max/stddev = 0.370/0.406/0.477/0.061<br />
PING 10.99.99.158: 120 data bytes<br />
128 bytes from 10.99.99.158: icmp_seq=0. time=0.395 ms<br />
128 bytes from 10.99.99.158: icmp_seq=1. time=0.361 ms<br />
128 bytes from 10.99.99.158: icmp_seq=2. time=0.264 ms</p>
<p><strong><span style="text-decoration: underline;"> CISCO routers (IOS)</span></strong></p>
<p>Defaults:<br />
IP packet size : 100 bytes ;  use <strong>size &lt;size&gt;</strong> to change<br />
Don’t fragment bit &#8211; not set  ;  use <strong>df-bit</strong> to set</p>
<p>Running with defaults:<br />
Tokyo#ping 191.91.21.41<br />
Type escape sequence to abort.<br />
Sending 5, 100-byte ICMP Echos to 191.91.21.41, timeout is 2 seconds:<br />
!!!!!<br />
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms</p>
<p>Receiving host:<br />
[root@darkstar ~]# tcpdump -n -v  -s 1500 icmp<br />
22:16:53.758056 IP (tos 0&#215;0, ttl 253, id 11, offset 0, <span style="color: #0000ff;">flags [none],</span> proto: ICMP (1), length: <span style="color: #0000ff;">100</span>) 174.93.31.134 &gt; 10.99.99.150: ICMP echo request, id 4, seq 0, length 80<br />
22:16:53.758246 IP (tos 0&#215;0, ttl  64, id 10923, offset 0, flags [none], proto: ICMP (1), length: 100) 10.99.99.150 &gt; 174.93.31.134 : ICMP echo reply, id 4, seq 0, length 80<br />
&lt; &#8212; Cut for brevity &#8211;&gt;<br />
Setting df bit and size of the packet size  (Note – here when you set size of the ping you set IP packet size and not ICMP data size as  in *Nix systems).<br />
Repeat count is set to 3 .<br />
Tokyo#ping 191.91.21.41 size 1300 df-bit rep 3<br />
Type escape sequence to abort.<br />
Sending 3, 1300-byte ICMP Echos to 191.91.21.41, timeout is 2 seconds:<br />
Packet sent with the DF bit set<br />
!!!<br />
Success rate is 100 percent (3/3), round-trip min/avg/max = 4/4/4 ms</p>
<p>Receiving host:<br />
[root@darkstar ~]# tcpdump -n -v  -s 1500 icmp<br />
22:18:16.657849 IP (tos 0&#215;0, ttl 253, id 21, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">1300)</span> 174.93.31.134  &gt; 10.99.99.150: ICMP echo request, id 6, seq 0, length 1280<br />
22:18:16.658028 IP (tos 0&#215;0, ttl  64, id 10933, offset 0, flags [none], proto: ICMP (1), length: 1300) 10.99.99.150 &gt; 174.93.31.134 : ICMP echo reply, id 6, seq 0, length 1280<br />
<span style="text-decoration: underline;">Sweeping ping size.</span><br />
This feature is available from extended ping menu:<br />
Rio#ping<br />
Protocol [ip]:<br />
Target IP address: 191.91.21.41<br />
Repeat count [5]:<br />
Datagram size [100]:<br />
Timeout in seconds [2]:<br />
Extended commands [n]: <span style="color: #0000ff;">y<br />
</span>Source address or interface:<br />
Type of service [0]:<br />
Set DF bit in IP header? [no]: y<br />
Validate reply data? [no]:<br />
Data pattern [0xABCD]:<br />
Loose, Strict, Record, Timestamp, Verbose[none]:<br />
<span style="color: #0000ff;">Sweep range of sizes [n]: y<br />
Sweep min size [36]:<br />
Sweep max size [18024]: 1700<br />
Sweep interval [1]: 100<br />
</span>Type escape sequence to abort.<br />
Sending 85, [36..1700]-byte ICMP Echos to 191.91.21.41, timeout is 2 seconds:<br />
Packet sent with the DF bit set<br />
!!!!!!!!!!!!!!<br />
Receiving host:<br />
10:35:22.563851 IP (tos 0&#215;0, ttl 253, id 179, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">36</span>) 174.93.31.134  &gt; 10.99.99.150: ICMP echo request, id 9, seq 0, length 16<br />
10:35:22.563891 IP (tos 0&#215;0, ttl  64, id 46861, offset 0, flags [none], proto: ICMP (1), length: 36) 10.99.99.150 &gt; 174.93.31.134 : ICMP echo reply, id 9, seq 0, length 16<br />
10:35:22.566205 IP (tos 0&#215;0, ttl 253, id 180, offset 0, <span style="color: #0000ff;">flags [DF],</span> proto: ICMP (1), length: <span style="color: #0000ff;">136</span>) 174.93.31.134  &gt; 10.99.99.150: ICMP echo request, id 9, seq 1, length 116<br />
10:35:22.566223 IP (tos 0&#215;0, ttl  64, id 46862, offset 0, flags [none], proto: ICMP (1), length: 136) 10.99.99.150 &gt; 174.93.31.134 : ICMP echo reply, id 9, seq 1, length 116</p>
<p><strong><span style="text-decoration: underline;">Juniper routers (JunOS):</span></strong><br />
Defaults:<br />
Ip packet size : 84 bytes<br />
Don’t fragment bit – not set; use <strong>do-not-fragment</strong> to set<br />
Interval  &#8211; 1 sec;  use <strong>interval &lt;secs&gt;</strong> to change<br />
Sending pings with df bit set and size 1470 bytes<br />
<a href="mailto:root@Juniper">root@Juniper</a>&gt; ping 192.168.37.29 do-not-fragment size 1470<br />
ping 192.168.37.29 do-not-fragment size 1470<br />
PING 192.168.37.29 (192.168.37.29): 1470 data bytes<br />
1478 bytes from 192.168.37.29: icmp_seq=0 ttl=64 time=1.434 ms<br />
1478 bytes from 192.168.37.29: icmp_seq=1 ttl=64 time=0.210 ms</p>
<p>&#8212; 192.168.37.29 ping statistics &#8212;<br />
4 packets transmitted, 4 packets received, 0% packet loss<br />
round-trip min/avg/max/stddev = 0.203/0.513/1.434/0.532 ms</p>
<p>IF packet size too large and df is set you get this:</p>
<p><a href="mailto:root@Juniper">root@Juniper</a>&gt; ping 192.168.37.29 do-not-fragment size 13000<br />
ping 192.168.37.29 do-not-fragment size 13000<br />
PING 192.168.37.29 (192.168.37.29): 13000 data bytes<br />
ping: sendto: Message too long</p>
]]></content:encoded>
			<wfw:commentRss>http://yurisk.info/2009/09/01/ping-setting-dont-fragment-bit-in-linuxfreebsdsolarisciscojuniper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

