<?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>Dynamips &#8211; Virtually Fun</title>
	<atom:link href="https://virtuallyfun.com/category/dynamips/feed/" rel="self" type="application/rss+xml" />
	<link>https://virtuallyfun.com</link>
	<description>Fun with Virtualization</description>
	<lastBuildDate>Thu, 28 May 2026 15:55:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Using MIT PC/IP with SLiRP &#038; a virtual Cisco Router</title>
		<link>https://virtuallyfun.com/2024/03/25/using-mit-pc-ip-with-slirp-a-virtual-cisco-router/</link>
					<comments>https://virtuallyfun.com/2024/03/25/using-mit-pc-ip-with-slirp-a-virtual-cisco-router/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Mon, 25 Mar 2024 18:47:19 +0000</pubDate>
				<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[pcap]]></category>
		<category><![CDATA[SLiRP]]></category>
		<category><![CDATA[videos]]></category>
		<category><![CDATA[virtual networking]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=14177</guid>

					<description><![CDATA[In this video I&#8217;ll be covering the circa 1985 MIT PC/IP stack running on 86box trying to connect to a user mode network library, SLiRP. After that fails I&#8217;ll show how to break the stack apart so we can use &#8230; <a href="https://virtuallyfun.com/2024/03/25/using-mit-pc-ip-with-slirp-a-virtual-cisco-router/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe title="Using MIT PC/IP with SLiRP &amp; a virtual Cisco Router" width="584" height="329" src="https://www.youtube.com/embed/N3F-LOMDtJw?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p class="wp-block-paragraph">In this video I&#8217;ll be covering the circa 1985 MIT PC/IP stack running on 86box trying to connect to a user mode network library, SLiRP. After that fails I&#8217;ll show how to break the stack apart so we can use WireShark to inspect the traffic, then how to replace the direct connection to SLiRP by using Dynamips to emulate a cisco 7200 router.</p>



<p class="wp-block-paragraph">Caution it&#8217;s all command line! </p>



<p class="wp-block-paragraph">I&#8217;ll cover adding a loop back adapter, installing WireShark, how to find the GUID&#8217;s of the interfaces, how to configure a HecNET bridge, and set it up to relay to a stand-alone version of SLiRP, then how to setup a virtual cisco router to do NAT, and also forward to SLiRP, along with taking network captures to show what is really going on! </p>



<p class="wp-block-paragraph">Software used (in no particular order)</p>



<ul class="wp-block-list">
<li><a href="https://86box.net/" target="_blank" rel="noreferrer noopener">https://86box.net/</a></li>



<li><a href="https://www.7-zip.org/download.htm" target="_blank" rel="noreferrer noopener">https://www.7-zip.org/download.htm</a></li>



<li><a href="https://www.wireshark.org/download.html" target="_blank" rel="noreferrer noopener">https://www.wireshark.org/download.html</a></li>



<li><a href="https://sourceforge.net/projects/dynamips-mingw/" target="_blank" rel="noreferrer noopener">https://sourceforge.net/projects/dynamips-mingw/</a></li>



<li><a href="https://sourceforge.net/projects/hecnetnt/" target="_blank" rel="noreferrer noopener">https://sourceforge.net/projects/hecnetnt/</a></li>



<li><a href="https://github.com/neozeed/dos211" target="_blank" rel="noreferrer noopener">https://github.com/neozeed/dos211</a></li>



<li><a href="https://github.com/neozeed/8086pcc" target="_blank" rel="noreferrer noopener">https://github.com/neozeed/8086pcc</a></li>
</ul>



<p class="wp-block-paragraph">Or for those who prefer the written way&#8230;</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability.png" target="_blank" rel="noreferrer noopener"><img fetchpriority="high" decoding="async" width="962" height="302" src="/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability.png" alt="" class="wp-image-14179" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability.png 962w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability-300x94.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability-768x241.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-slirp-eq-no-visability-500x157.png 500w" sizes="(max-width: 962px) 100vw, 962px" /></a><figcaption class="wp-element-caption">what is going on?</figcaption></figure>



<p class="wp-block-paragraph">In 86box, you have the ability to use the SLiRP library directly from the emulator.  Which is all find and good, but sadly it gives you no visibility when things go wrong.  And with MIT PC/IP things go wrong.  Looking at the data through Wireshark sure would be nice, but how to we get it into there?</p>



<p class="wp-block-paragraph">Well the simplest way is to just break it apart.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability.png" target="_blank" rel="noreferrer noopener"><img decoding="async" width="1017" height="576" src="/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability.png" alt="" class="wp-image-14181" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability.png 1017w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability-300x170.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability-768x435.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/86box-plus-loop-plus-hecnet-eq-visability-500x283.png 500w" sizes="(max-width: 1017px) 100vw, 1017px" /></a><figcaption class="wp-element-caption">Broken apart into it&#8217;s components</figcaption></figure>



<p class="wp-block-paragraph">Adding in a KM TEST loopback adapter to Windows now gives us a private network we can now attach programs to via the pcap API.  Hecnet is a l2 bridge that can inspect and look for l3 traffic and then forward it via udp to another program.  In this case I had made a version of <a href="https://sourceforge.net/p/dynamips-mingw/code/ci/master/tree/dynamips-master/common/slirp_rdr.c" target="_blank" rel="noreferrer noopener">SLiRP that will communicate via UDP</a>, perfect for stuff like this!</p>



<p class="wp-block-paragraph">One thing to keep in mind is that the &#8216;GUIDS&#8217; of the network interfaces are unique to each system, the ethlist program will show you which is which.  It&#8217;s also why renaming interfaces only helps you when dealing with old libpcap stuff!</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="787" height="194" src="/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip.png" alt="" class="wp-image-14186" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip.png 787w, https://virtuallyfun.com/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip-300x74.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip-768x189.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/network-interface-names-for-mit-pcip-500x123.png 500w" sizes="auto, (max-width: 787px) 100vw, 787px" /></a><figcaption class="wp-element-caption">Rename stuff so it makes sense!  Otherwise, everything is Ethernet</figcaption></figure>



<p class="wp-block-paragraph">Becomes:</p>



<pre class="wp-block-code"><code>C:\hecnet>ethlist.exe
Network devices:
  Number       NAME                                     (Description)
  0  \Device\NPF_{E7EB72FA-7850-4864-B721-2A3B38737214} (KM-TEST)
  1  \Device\NPF_{649448CA-969D-486E-AAC8-99F1993C701A} (Ethernet0)
Press Enter to continue...

C:\hecnet></code></pre>



<p class="wp-block-paragraph">With this information in hand, creating the bridge configuration is quite simple:</p>



<pre class="wp-block-code"><code>&#91;bridge]
Loop \Device\NPF_{E7EB72FA-7850-4864-B721-2A3B38737214}
update 127.0.0.1:5001

&#91;tcpip]
Loop
update</code></pre>



<p class="wp-block-paragraph">The bridge is for an uncompressed normal bridge connection between the KM TEST loopback interface and a UDP connection listening on port 5001 on localhost.  Of note it&#8217;ll be forwarding TCP/IP related packets. Since we want the bridge to listen on UDP port 5000 we simply run it like this:</p>



<pre class="wp-block-code"><code>hecnet.exe 5000</code></pre>



<p class="wp-block-paragraph">Running the SLiRP redirector is just a simple matter of telling it which port to listen on, and where to forward traffic.  In this case we&#8217;ll listen on port 5001 and forward traffic to 5000 on the localhost</p>



<pre class="wp-block-code"><code>slirp_rdr.exe 5001 127.0.0.1 5000</code></pre>



<p class="wp-block-paragraph">Thankfully, it&#8217;s that simple! </p>



<p class="wp-block-paragraph">Running a ping fails (yet again) but this time we can see that they are doing ARP but for some reason PC/IP does not acknowledge the SLiRP library.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="858" height="187" src="/wp-content/uploads/2024/03/mit-pcip-no-working-arp.png" alt="" class="wp-image-14182" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp.png 858w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-300x65.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-768x167.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-500x109.png 500w" sizes="auto, (max-width: 858px) 100vw, 858px" /></figure>



<p class="wp-block-paragraph">Just to verify, the HecnetNT bridge does see the source and destination address, and the SLiRP does indicate traffic in and out as expected.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="689" height="549" src="/wp-content/uploads/2024/03/mit-pcip-no-working-arp-stats-jpg.webp" alt="" class="wp-image-14183" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-stats-jpg.webp 689w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-stats-300x239.webp 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-no-working-arp-stats-377x300.webp 377w" sizes="auto, (max-width: 689px) 100vw, 689px" /></figure>



<p class="wp-block-paragraph">Clearly the fault is on the PC/IP side, and most likely because it&#8217;s so old.</p>



<p class="wp-block-paragraph">I then decided to build another network, this time using Dynamips to add in a virtual router.</p>



<figure class="wp-block-image size-large is-resized"><a href="/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-jpg.webp"><img loading="lazy" decoding="async" width="1024" height="527" src="/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-1024x527.webp" alt="" class="wp-image-14185" style="width:615px;height:auto" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-1024x527.webp 1024w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-300x154.webp 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-768x395.webp 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-500x257.webp 500w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-dynamips-network-diagram2-jpg.webp 1058w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Adding in a router</figcaption></figure>



<p class="wp-block-paragraph">This complicates things as I&#8217;m not sure how to control the internal routing of the SLiRP library so the router has to NAT the PC/IP traffic to SLiRP, which in turn &#8216;NATs&#8217; it to the internet.  But rest assured double NAT (or even more) is quite common these days.</p>



<p class="wp-block-paragraph">Configuring the router is somewhat straight forward, we are going to use pcap to listen on the KM TEST loopack, replacing the HecnetNT bridge.  But it&#8217;s going to talk to the SLiRP redirector in the same manner:</p>



<pre class="wp-block-code"><code>set loopback=\Device\NPF_{E7EB72FA-7850-4864-B721-2A3B38737214}
set IOS=..\c7200-is-mz.19991126.bin
set NPE=npe-100
set RAM=64 -X

@attrib *.* -r
..\dynamips.exe -P 7200 %IOS%  ^
-m %RAM% ^
-t %NPE%  ^
-p 0:C7200-IO-FE ^
-p 1:PA-4E  ^
-s1:0:gen_eth:%loopback% ^
-s1:1:udp:5000:127.0.0.1:5001</code></pre>



<p class="wp-block-paragraph">This creates a basic 7200 router with a 4 port ethernet card, with one port connected to the KM TEST loopback, and the other connected to the SLiRP library.</p>



<p class="wp-block-paragraph">Configuration of the router is not very complicated either:</p>



<pre class="wp-block-code"><code>!
no ip domain-lookup
!
interface Ethernet1/0
 ip address 192.168.1.1 255.255.255.0
 no ip directed-broadcast
 ip nat inside
!
interface Ethernet1/1
 ip address 10.0.2.15 255.255.255.0
 no ip directed-broadcast
 ip nat outside
!
ip default-gateway 10.0.2.2
ip nat inside source list 1 interface Ethernet1/1 overload
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.2.2
no ip http server
!
access-list 1 permit 192.168.1.0 0.0.0.255
!

</code></pre>



<p class="wp-block-paragraph">This defines our default route for both the routing table, and the management engine to the SLiRP library, defines the NAT inside/outside interfaces along with specifying the &#8216;overload&#8217; address will be the 10.0.2.15 NAT&#8217;ing the PC/IP traffic behind the usual SLiRP user address.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="729" height="448" src="/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router.png" alt="" class="wp-image-14188" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router.png 729w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-300x184.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-488x300.png 488w" sizes="auto, (max-width: 729px) 100vw, 729px" /></a><figcaption class="wp-element-caption">Pinging the SLiRP gateway</figcaption></figure>



<p class="wp-block-paragraph">This allows us to ping SLiRP, and get the expected response.</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture.png"><img loading="lazy" decoding="async" width="1025" height="729" src="/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture.png" alt="" class="wp-image-14189" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture.png 1025w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture-300x213.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture-768x546.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-pinging-slirp-through-cisco-router-capture-422x300.png 422w" sizes="auto, (max-width: 1025px) 100vw, 1025px" /></a><figcaption class="wp-element-caption">Working ARP/ICMP with cisco router</figcaption></figure>



<p class="wp-block-paragraph">Checking the capture, we can see that yes ARP is working as expected, and the ping works without any issues.</p>



<p class="wp-block-paragraph">On the router we can see the NAT translation.</p>



<pre class="wp-block-code"><code>Router#show ip nat translations
Pro Inside global      Inside local       Outside local      Outside global
tcp 10.0.2.15:4376     192.168.1.5:4376   71.95.196.34:23    71.95.196.34:23
Router#</code></pre>



<p class="wp-block-paragraph">And we can also check the SLiRP redirector for information on the current session.</p>



<pre class="wp-block-code"><code>SLiRP redirector started!
Press 's' for SLiRP stats
Press 'e' to exit.

Sent:           Recv:
stats!          4859

Proto&#91;state]     Sock     Local Address, Port  Remote Address, Port RecvQ SendQ
tcp&#91;ESTABLISHED]  632         10.0.2.15  4376    71.95.196.34    23     0   600
tcp&#91;REDIRECT]     616         10.0.2.15    23        10.0.2.2 42323     0     0

</code></pre>



<p class="wp-block-paragraph">Plus, we also have the Wireshark capture going showing the start of the TCP conversation</p>



<figure class="wp-block-image size-full"><a href="/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture.png" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="1025" height="731" src="/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture.png" alt="" class="wp-image-14190" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture.png 1025w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture-300x214.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture-768x548.png 768w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-telnet-slirp-through-cisco-router-capture-421x300.png 421w" sizes="auto, (max-width: 1025px) 100vw, 1025px" /></a><figcaption class="wp-element-caption">TCP connected!</figcaption></figure>



<figure class="wp-block-image size-full"><a href="https://www.synchro.net/" target="_blank" rel="noreferrer noopener"><img loading="lazy" decoding="async" width="764" height="478" src="/wp-content/uploads/2024/03/mit-pcip-connected-to-vert.png" alt="" class="wp-image-14192" srcset="https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-connected-to-vert.png 764w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-connected-to-vert-300x188.png 300w, https://virtuallyfun.com/wp-content/uploads/2024/03/mit-pcip-connected-to-vert-479x300.png 479w" sizes="auto, (max-width: 764px) 100vw, 764px" /></a><figcaption class="wp-element-caption">Connected to VERT</figcaption></figure>



<p class="wp-block-paragraph">So now we&#8217;ve connected to the internet and by breaking the process appart we can now inspect what is going on, and made modifications like adding a cisco router.</p>



<p class="wp-block-paragraph">I figured that this may be something that other people may be interested in, as you can build far more complex virtual networks this way!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2024/03/25/using-mit-pc-ip-with-slirp-a-virtual-cisco-router/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ghosts in the mainframe!</title>
		<link>https://virtuallyfun.com/2023/05/26/ghosts-in-the-mainframe/</link>
					<comments>https://virtuallyfun.com/2023/05/26/ghosts-in-the-mainframe/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 26 May 2023 08:36:50 +0000</pubDate>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[cisco networking]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[mainframe]]></category>
		<category><![CDATA[netbeui]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[pcap]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[virtual networking]]></category>
		<guid isPermaLink="false">http://virtuallyfun.com/?p=12668</guid>

					<description><![CDATA[There is a LOT going on in this image, and I&#8217;ll try to explain it, but yeah &#8220;it&#8217;s complicated&#8221;. SNA networking &#38; Hercules has always been a goal for a lot of people, including me as we always wanted to &#8230; <a href="https://virtuallyfun.com/2023/05/26/ghosts-in-the-mainframe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost-1024x643.png" alt="" class="wp-image-12669" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost-1024x643.png 1024w, https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost-300x188.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost-768x482.png 768w, https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost-478x300.png 478w, https://virtuallyfun.com/wp-content/uploads/2023/05/dlsw-herc-almost.png 1468w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="wp-block-paragraph">There is a LOT going on in this image, and I&#8217;ll try to explain it, but yeah &#8220;it&#8217;s complicated&#8221;.</p>



<p class="wp-block-paragraph">SNA networking &amp; Hercules has always been a goal for a lot of people, including me as we always wanted to setup some SNA server of some kind.  Especially on RISC platforms, as there is only so much fun on SQL server.</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box.jpg"><img loading="lazy" decoding="async" width="1008" height="756" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box.jpg" alt="" class="wp-image-12670" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box.jpg 1008w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box-300x225.jpg 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box-768x576.jpg 768w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-1.0-in-box-400x300.jpg 400w" sizes="auto, (max-width: 1008px) 100vw, 1008px" /></a></figure>



<p class="wp-block-paragraph">Okay I know the practical among you will say, doesn&#8217;t it support telnet 3270? Isn&#8217;t that good enough?  Yes for day to day mundane stuff, absolutely.  But I&#8217;m not all that interested in that, I wan&#8217;t to have the whole ancient network, and I wan&#8217;t it self contained and on my desk!  Or on a laptop, as I see fit.</p>



<p class="wp-block-paragraph">What started this whole adventure was a simple image from <a rel="noreferrer noopener" href="https://www.9track.net/hercules/dlsw/" target="_blank">9track.net</a>, showing that being able to connect physical devices to Hercules was indeed possible!</p>



<figure class="wp-block-image size-full"><a href="https://www.9track.net/hercules/dlsw/"><img loading="lazy" decoding="async" width="800" height="600" src="https://virtuallyfun.com/wp-content/uploads/2023/05/ibm3174_01.jpg" alt="Image from https://www.9track.net/hercules/dlsw/" class="wp-image-12671" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/ibm3174_01.jpg 800w, https://virtuallyfun.com/wp-content/uploads/2023/05/ibm3174_01-300x225.jpg 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/ibm3174_01-768x576.jpg 768w, https://virtuallyfun.com/wp-content/uploads/2023/05/ibm3174_01-400x300.jpg 400w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>



<p class="wp-block-paragraph">This is a physical IBM 3178 &amp; 3179 terminals talking to <a rel="noreferrer noopener" href="https://wotho.ethz.ch/tk4-/" target="_blank">TK4-</a> , a MVS3.8j pre-configured system!</p>



<p class="wp-block-paragraph">The magic that makes this all possible, is a cisco router, running enterprise IOS, with dlsw support.</p>



<p class="wp-block-paragraph">My setup is going to be inspired by this setup, but not exactly 100% But this is what I&#8217;m going to use on Windows 10</p>



<ul class="wp-block-list">
<li><a href="https://sourceforge.net/projects/dynamips-mingw/" target="_blank" rel="noreferrer noopener">Dynamips</a> for the cisco router, running JS-M 12.2(25)S8</li>



<li><a href="https://sourceforge.net/projects/qemu090b/files/sidesteps/qemu-0.90-pcap-client.7z/download" target="_blank" rel="noreferrer noopener">Qemu</a> 0.90 with PCAP running Windows NT 3.51 Server along with SNA Server 2.1</li>



<li><a href="https://sourceforge.net/projects/qemu090b/" target="_blank" rel="noreferrer noopener">Qemu</a> 0.90 running Windows 3.1 and XVision</li>



<li>VMware Player</li>



<li><a href="https://www.wireshark.org/" target="_blank" rel="noreferrer noopener">WireShark</a></li>



<li>Microsoft Loopback adapter</li>



<li>WSLv1</li>
</ul>



<p class="wp-block-paragraph">I had originally wanted  to run the NT server on VMware but for some reason it just hangs trying to initialise the NT kernel.  I didn&#8217;t bother trying to troubleshoot it, I just jumped to Qemu.  Even service pack 5 didn&#8217;t help.  VMware left me with the virtual network that will NAT if needed, and of course let me telnet to the Dynamips program.  The SNA traffic is isolated to the MS Loopback adapter, which will let pcap programs talk to each other.</p>



<p class="wp-block-paragraph">The first thing I did was run &#8216;hdwwiz&#8217; on Windows 10, and added in the KM-TEST loopback adapter </p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-1.png"><img loading="lazy" decoding="async" width="578" height="428" src="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-1.png" alt="" class="wp-image-12672" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-1.png 578w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-1-300x222.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-1-405x300.png 405w" sizes="auto, (max-width: 578px) 100vw, 578px" /></a></figure>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-2.png"><img loading="lazy" decoding="async" width="578" height="428" src="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-2.png" alt="" class="wp-image-12673" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-2.png 578w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-2-300x222.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-2-405x300.png 405w" sizes="auto, (max-width: 578px) 100vw, 578px" /></a></figure>



<p class="wp-block-paragraph">We know what we want, so go to the manuall selection</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-3.png"><img loading="lazy" decoding="async" width="578" height="428" src="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-3.png" alt="" class="wp-image-12674" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-3.png 578w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-3-300x222.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-3-405x300.png 405w" sizes="auto, (max-width: 578px) 100vw, 578px" /></a></figure>



<p class="wp-block-paragraph">Network adapters</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-4.png"><img loading="lazy" decoding="async" width="578" height="428" src="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-4.png" alt="" class="wp-image-12675" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-4.png 578w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-4-300x222.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/hdwwiz-4-405x300.png 405w" sizes="auto, (max-width: 578px) 100vw, 578px" /></a></figure>



<p class="wp-block-paragraph">And select the KM-TEST Loopback Adapter</p>



<p class="wp-block-paragraph">Next I changed the protocols available on the loopback, as I don&#8217;t want my Windows 10 host interfering with the SNA network at all.</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/loopback-adapter-protocols.png"><img loading="lazy" decoding="async" width="364" height="552" src="https://virtuallyfun.com/wp-content/uploads/2023/05/loopback-adapter-protocols.png" alt="" class="wp-image-12676" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/loopback-adapter-protocols.png 364w, https://virtuallyfun.com/wp-content/uploads/2023/05/loopback-adapter-protocols-198x300.png 198w" sizes="auto, (max-width: 364px) 100vw, 364px" /></a></figure>



<p class="wp-block-paragraph">So the next thing to do is to get your network GUID&#8217;s.  ethlist.exe from the Dynamips download will get you that:</p>



<pre class="wp-block-code"><code>C:\dynamips&gt;ethlist.exe
Network devices:
  Number       NAME                                     (Description)
  0  \Device\NPF_{3DF0EC5D-7FBE-46DF-ACF8-EF5D8679A473} (loopback)
  1  \Device\NPF_{D9FBD118-B9DF-4C3C-BD9E-07A0E34D8F75} (Local Area Connection* 8)
  2  \Device\NPF_{F5057901-6A30-413A-80E4-4765DA794B7C} (Local Area Connection* 7)
  3  \Device\NPF_{E3D3EC8D-29C3-4B70-B01C-600D3F9ED1D6} (Local Area Connection* 6)
  4  \Device\NPF_{82EEDBC1-899D-416F-BD51-3DBE2287257F} (VMware Network Adapter VMnet8)
  5  \Device\NPF_{3BC364F4-5A15-405D-926C-C594383F0323} (VMware Network Adapter VMnet1)
  6  \Device\NPF_{DDF1FA94-7488-414F-A41A-EC88C1FB0DE4} (Ethernet)
  7  \Device\NPF_{E7CA8F40-4639-410D-B5CA-F402FE69AF5D} (Ethernet 2)</code></pre>



<p class="wp-block-paragraph">I want the cisco router to have two interfaces, one with TCP/IP for me to be able to telnet into it (maybe other management as well?!)  and the other one for the SNA traffic.</p>



<h2 class="wp-block-heading">Setting up Dynamips</h2>



<p class="wp-block-paragraph">As mentioned above I&#8217;m going to use the VMnet1 for TCP/IP to the router, and the loopback adapter for SNA traffic.  To try to make things a little easier to read I setup a small batch file that let&#8217;s me plug in variables to Dynamips:</p>



<pre class="wp-block-code"><code>set loopback=\Device\NPF_{3DF0EC5D-7FBE-46DF-ACF8-EF5D8679A473}
set vmnet1=\Device\NPF_{3BC364F4-5A15-405D-926C-C594383F0323}
set IOS=c7200-js-mz.122-25.S8.bin
set NPE=npe-200
..\dynamips.exe -P 7200 %IOS%  ^
-t %NPE%  ^
-p 0:C7200-IO-FE ^
-s0:0:gen_eth:%vmnet1% ^
-p 1:PA-4E  ^
-s1:0:gen_eth:%loopback% ^
-p2:PA-4T+</code></pre>



<p class="wp-block-paragraph">The caret symbol will break up lines on NT, much like the ampersand will on Unix.  And this let&#8217;s me use clear variables for the networks, IOS &amp; NPE type so it&#8217;s nowhere near as complicated to edit.</p>



<p class="wp-block-paragraph">This will create a cisco 7200 with an NPE-200, with the following cards:</p>



<ul class="wp-block-list">
<li><a href="https://www.cisco.com/c/en/us/td/docs/routers/7200/install_and_upgrade/7200_i-o_controller_install/4447io.html" target="_blank" rel="noreferrer noopener">C7200-IO-FE</a></li>



<li><a href="https://www.cisco.com/c/en/us/td/docs/interfaces_modules/port_adapters/install_upgrade/ethernet/pa-4e_10baset_install_config/pa_4e/3493over.html" target="_blank" rel="noreferrer noopener">PA-4E</a></li>



<li><a href="https://www.cisco.com/c/en/us/td/docs/interfaces_modules/port_adapters/install_upgrade/serial/pa-4t_sync_serial_install_config/pa_4t/3560over.html" target="_blank" rel="noreferrer noopener">PA-4T+</a></li>
</ul>



<p class="wp-block-paragraph">The next thing is what ip address is bound to VMnet1?  This is mine:</p>



<pre class="wp-block-code"><code>Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::c3d2:c891:b7e0:6797%5
   IPv4 Address. . . . . . . . . . . : 192.168.199.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :
</code></pre>



<p class="wp-block-paragraph">So all my TCP/IP in this example will be using 192.168.199.0/24</p>



<p class="wp-block-paragraph">As mentioned on the <a rel="noreferrer noopener" href="https://www.9track.net/hercules/dlsw/" target="_blank">9track page</a>, all the magic happens on the cisco router.  I&#8217;ve made a few changes as I may want to try the SDLC in the future to perhaps some other experiment if I can find an emulator that&#8217;ll drive it over serial, but for now let&#8217;s just get to the config:</p>



<pre class="wp-block-code"><code>!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname dlsw
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
ip subnet-zero
!
!
no ip domain-lookup
!
ip cef
no mpls traffic-eng auto-bw timers frequency 0
call rsvp-sync
!
!
!
!
!
!
!
source-bridge ring-group 1
dlsw local-peer peer-id 192.168.199.10
dlsw remote-peer 0 tcp 192.168.199.1
dlsw mac-addr 4000.1020.0100 remote-peer ip-address 192.168.199.1
dlsw udp-disable
dlsw transparent switch-support
!
interface FastEthernet0/0
 ip address 192.168.199.10 255.255.255.0
 duplex half
 no clns route-cache
!
interface Ethernet1/0
 no ip address
 duplex half
 no clns route-cache
 dlsw transparent redundancy-enable 5555.5555.5000
 dlsw transparent map local-mac 4000.1020.0100  remote-mac 4000.0999.0100
!
interface Ethernet1/1
 no ip address
 shutdown
 duplex half
 no clns route-cache
!
interface Ethernet1/2
 no ip address
 shutdown
 duplex half
 no clns route-cache
!
interface Ethernet1/3
 no ip address
 shutdown
 duplex half
 no clns route-cache
!
interface Serial2/0
 no ip address
 encapsulation sdlc
 no keepalive
 serial restart-delay 0
 clockrate 64000
 no clns route-cache
 sdlc role primary
 sdlc vmac 4000.0999.0100
 sdlc address C1
 sdlc xid C1 01700019
 sdlc partner 4000.1020.1000 C1
 sdlc dlsw C1
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
 no clns route-cache
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
 no clns route-cache
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
 no clns route-cache
!
ip classless
!
no ip http server
!
!
!
!
!
!
control-plane
!
!
dial-peer cor custom
!
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 session-timeout 35791
 stopbits 1
line aux 0
 stopbits 1
line vty 0 4
 password cisco
 login
!
!
end</code></pre>



<p class="wp-block-paragraph">This sets up the router so I can telnet to it from my desktop at 192.168.199.10, and allows it to talk to the base Windows machine on 192.168.199.1</p>



<p class="wp-block-paragraph">All the magical MAC addresses come from <a href="https://www.9track.net/hercules/dlsw/">9track.net</a>, as he wrote the dlsw hooks, so I just copied that.  There is probably a great deal that could be cleaned up, but once I saw the two talking I kind of froze what I was doing.</p>



<p class="wp-block-paragraph">With that much in place I then jumped to WSL,and built the emulator from <a rel="noreferrer noopener" href="https://github.com/9track/hyperion/tree/dlsw" target="_blank">github</a>. I cloned it, and renamed that to herc-dlsw. At least for me this was pretty straightforward. The Hercules fork will build with Visual Studio as well, but I knew I was going to need some kind of tn3270 emulator, and I wanted to use x3270, and I had just recently bought this discounted copy of XVision, so of course I wanted to use that.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="643" height="145" src="https://virtuallyfun.com/wp-content/uploads/2023/05/Xvision-Server-30-days.png" alt="" class="wp-image-12677" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/Xvision-Server-30-days.png 643w, https://virtuallyfun.com/wp-content/uploads/2023/05/Xvision-Server-30-days-300x68.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/Xvision-Server-30-days-500x113.png 500w" sizes="auto, (max-width: 643px) 100vw, 643px" /></figure>



<p class="wp-block-paragraph">Despite this catastrophic defect that wasn&#8217;t disclosed in the auction.</p>



<p class="wp-block-paragraph">I downloaded and extracted the <a rel="noreferrer noopener" href="https://wotho.ethz.ch/tk4-/" target="_blank">TK4-</a> latest distro on WSL. I just created a &#8216;herc&#8217; directory in my home to house the tk4- release. The next thing to do is overlay your dlsw enabled exe&#8217;s and libraries.</p>



<pre class="wp-block-code"><code>cd ~/herc-dlsw/.libs
mkdir x
cp * x
cd x
rm *.o *.lai
cp *.so $HOME/herc/hercules/linux/64/lib/hercules
cp *.la $HOME/herc/hercules/linux/64/lib/hercules
rm *.so *.la
cp * $HOME/herc/hercules/linux/64
</code></pre>



<p class="wp-block-paragraph">Now with the binaries in place, I do need to setup the Xvision VM so I can receive the X11.  Of course there is so many other ways to do this, but this is mine:</p>



<pre class="wp-block-code"><code>qemu.exe -L pc-bios -m 64 -hda xvision.vmdk -net nic,model=ne2k_isa -net user -redir tcp:6000::6000</code></pre>



<p class="wp-block-paragraph">The important thing is that tcp port 6000 is redirected inwards, and that I&#8217;m using the NE2000 card, which on my weird fork will print out the hardware config, so I know how to find the nic.</p>



<pre class="wp-block-code"><code>added SLIRP
adding a &#91;GenuineIntelC&#x2663;] family 5 model 4 stepping 3 CPU
added 64 megabytes of RAM
trying to load video rom pc-bios/vgabios-cirrus.bin
added parallel port 0x378 7
added NE2000(isa) 0x320 10
pci_piix3_ide_init PIIX3 IDE
ide_init2 &#91;0] s-&gt;cylinders 203 s-&gt;heads 16 s-&gt;sectors 63
ide_init2 &#91;1] s-&gt;cylinders 0 s-&gt;heads 0 s-&gt;sectors 0
ide_init2 &#91;0] s-&gt;cylinders 2 s-&gt;heads 16 s-&gt;sectors 63
ide_init2 &#91;1] s-&gt;cylinders 0 s-&gt;heads 0 s-&gt;sectors 0
added PS/2 keyboard
ps2.c added PS/2 mouse handler
added Floppy Controller 0x3f0 irq 6 dma 2
installing PS/2 mouse in CMOS
  Bus  0, device   0, function 0:
    Host bridge: PCI device 8086:1237
  Bus  0, device   1, function 0:
    ISA bridge: PCI device 8086:7000
  Bus  0, device   1, function 1:
    IDE controller: PCI device 8086:7010
      BAR4: I/O at 0xffffffff &#91;0x000e].
  Bus  0, device   1, function 3:
    Class 0680: PCI device 8086:7113
      IRQ 0.
  Bus  0, device   2, function 0:
    VGA controller: PCI device 1013:00b8
      BAR0: 32 bit memory at 0xffffffff &#91;0x01fffffe].
      BAR1: 32 bit memory at 0xffffffff &#91;0x00000ffe].</code></pre>



<p class="wp-block-paragraph">And in this case it&#8217;s 0x320 IRQ 10.  XVision being it&#8217;s own level of disappointment, I&#8217;ll have to cover it further, and later but suffice to say it at least catches the x3270 so I can get onto the console.</p>



<h2 class="wp-block-heading">Setting up Hercules</h2>



<p class="wp-block-paragraph">Editing conf/tk4-_default.cnf is pretty easy as it&#8217;s on Linux and you can use VI.</p>



<pre class="wp-block-code"><code># NCP VTAM
#
0660 3705 lport=${N660PORT:=37051} locncpnm=N07 rmtncpnm=N08 …
          unitsz=252 ackspeed=1000
0661 3705 lport=${N661PORT:=37052} locncpnm=N10 rmtncpnm=N11 …
          idblk=017 idnum=00018 locsuba=10 rmtsuba=11 unitsz=252 …
          ackspeed=1000
0662 3705 lport=${N662PORT:=37053} <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-blue-color">debug=yes dlsw=yes</mark> locncpnm=N12 …
          rmtncpnm=N13 idblk=017 idnum=00019 locsuba=12 rmtsuba=13 …
          unitsz=252 ackspeed=1000
0663 3705 lport=${N663PORT:=37054} locncpnm=N14 rmtncpnm=N15 idblk=017 …
          idnum=0001a locsuba=14 rmtsuba=15 unitsz=252 ackspeed=1000</code></pre>



<p class="wp-block-paragraph">And it&#8217;s simple, just assign the dlsw to the 0662 3705 controller.</p>



<p class="wp-block-paragraph">The real fun is in the VTAM configuration.  Which had been stumping me for well over a year.  But then I found this <a href="https://bradricorigg.medium.com/?source=post_page-----55fa7c982553--------------------------------">Bradrico Rigg</a> article aptly titled : <a rel="noreferrer noopener" href="https://bradricorigg.medium.com/run-your-own-mainframe-using-hercules-mainframe-emulator-and-mvs-3-8j-tk4-55fa7c982553" target="_blank">Run your own mainframe using Hercules mainframe emulator and MVS 3.8j tk4</a>, and it gave me the confidence to get this <em>DONE</em>.  Thanks Bradrico!</p>



<p class="wp-block-paragraph">First get MVS up and running.  You have to run the &#8216;console_mode&#8217; script to see what is going on.</p>



<pre class="wp-block-code"><code>cd herc/unattended
./set_console_mode
cd ..
./mvs</code></pre>



<p class="wp-block-paragraph">It&#8217;s not all that difficult  XVision is using SLiRP, so it&#8217;s listening on all my IP addresses so I just do a simple </p>



<pre class="wp-block-code"><code>export DISPLAY=192.168.1.72:0
nohup x3270 &amp;</code></pre>



<p class="wp-block-paragraph">And the emulator will pop up in Qemu.  Just connect to localhost:3270 and you&#8217;ll be greeted by the login pannel:</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-console-login.png"><img loading="lazy" decoding="async" width="584" height="444" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-console-login.png" alt="" class="wp-image-12678" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-console-login.png 584w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-console-login-300x228.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-console-login-395x300.png 395w" sizes="auto, (max-width: 584px) 100vw, 584px" /></a></figure>



<p class="wp-block-paragraph">Credentials are HERC01 / CUL8TR</p>



<p class="wp-block-paragraph">I would HIGHLY recommend following the tutorial to get used to submitting a simple COBOL program.  It walks through the key concepts of locating a file, and viewing it on MVS.  Something that up until yesterday was out of my league.</p>



<p class="wp-block-paragraph">We need to edit the file S3705 on SYS1.VTAMLST</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-main-pannel.png"><img loading="lazy" decoding="async" width="574" height="332" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-main-pannel.png" alt="" class="wp-image-12679" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-main-pannel.png 574w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-main-pannel-300x174.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-main-pannel-500x289.png 500w" sizes="auto, (max-width: 574px) 100vw, 574px" /></a></figure>



<p class="wp-block-paragraph">Basically it&#8217;s 1,3,4 from the main pannel:</p>



<p class="wp-block-paragraph">or RFE, Utilities, DSLIST</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-name.png"><img loading="lazy" decoding="async" width="504" height="297" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-name.png" alt="" class="wp-image-12680" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-name.png 504w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-name-300x177.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-name-500x295.png 500w" sizes="auto, (max-width: 504px) 100vw, 504px" /></a></figure>



<p class="wp-block-paragraph">Type in the Volume name, then tab over to the left of the volume and put in V to view</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list.png"><img loading="lazy" decoding="async" width="573" height="110" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list.png" alt="" class="wp-image-12681" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list.png 573w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-300x58.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-500x96.png 500w" sizes="auto, (max-width: 573px) 100vw, 573px" /></a></figure>



<p class="wp-block-paragraph">Now we will get a list of all the files.  We want to edit S3705, so you can tab/arrow down, but sure to put an `E&#8217; next to it, then hit enter so we can edit the file</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-edit.png"><img loading="lazy" decoding="async" width="566" height="327" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-edit.png" alt="" class="wp-image-12682" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-edit.png 566w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-edit-300x173.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-edit-500x289.png 500w" sizes="auto, (max-width: 566px) 100vw, 566px" /></a></figure>



<p class="wp-block-paragraph">F7/F8 will page down/page up as needed. As mentioned we are interested in Subarea 13, PU type 2.</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-before.png"><img loading="lazy" decoding="async" width="565" height="269" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-before.png" alt="" class="wp-image-12683" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-before.png 565w, https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-before-300x143.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-before-500x238.png 500w" sizes="auto, (max-width: 565px) 100vw, 565px" /></a></figure>



<p class="wp-block-paragraph">The line we are changing is the MAXDATA or MTU size for this unit.  Since we are doing dlsw, or an emulated serial link, we need to knock it down to 256.  Notice all the plus signs on the right hand? THOSE ARE IMPORTANT!  Not only do they need to exist, but they also have to be on the far right.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/mtu-sizes.png"><img loading="lazy" decoding="async" width="377" height="236" src="https://virtuallyfun.com/wp-content/uploads/2023/05/mtu-sizes.png" alt="" class="wp-image-12684" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/mtu-sizes.png 377w, https://virtuallyfun.com/wp-content/uploads/2023/05/mtu-sizes-300x188.png 300w" sizes="auto, (max-width: 377px) 100vw, 377px" /></a></figure>
</div>


<p class="wp-block-paragraph">For those wondering the MTU sizes on the client side by media type are as follows:  And notice that the host size is different, as this takes in account of packet headers.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="561" height="273" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-after.png" alt="" class="wp-image-12685" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-after.png 561w, https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-after-300x146.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sub-area-13-pu-type-2-after-500x243.png 500w" sizes="auto, (max-width: 561px) 100vw, 561px" /></figure>



<p class="wp-block-paragraph">Making sure to overtype the 3780, to a 256, and ensuring the + sign hasn&#8217;t moved you can hit enter, cursor to the top and type in SAVE.</p>



<p class="wp-block-paragraph">We can then edit the N13 file, changing line 35 to have MAXLU=3</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-n13.png"><img loading="lazy" decoding="async" width="563" height="183" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-n13.png" alt="" class="wp-image-12686" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-n13.png 563w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-n13-300x98.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-n13-500x163.png 500w" sizes="auto, (max-width: 563px) 100vw, 563px" /></a></figure>



<p class="wp-block-paragraph">Hopefully this clears up editing VTAM files.</p>



<p class="wp-block-paragraph">As mentioned the easiest way to regen the system is to delete the old object files.  So hit f3 a few times and get back to the dataset list</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="555" height="297" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-vtamobj.png" alt="" class="wp-image-12687" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-vtamobj.png 555w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-vtamobj-300x161.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-list-vtamobj-500x268.png 500w" sizes="auto, (max-width: 555px) 100vw, 555px" /></figure>



<p class="wp-block-paragraph">This time we want the VTAMOBJ set.  Go and &#8216;V&#8217;iew it like last time and we will get the list of files:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="568" height="272" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-vtamobj-flag-for-delete.png" alt="" class="wp-image-12688" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-vtamobj-flag-for-delete.png 568w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-vtamobj-flag-for-delete-300x144.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-vtamobj-flag-for-delete-500x239.png 500w" sizes="auto, (max-width: 568px) 100vw, 568px" /></figure>



<p class="wp-block-paragraph">Now we are going to put a &#8216;d&#8217; next to N13 and S3705.  This will flag them for deletion.  Hit enter!</p>



<figure class="wp-block-image size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-delete-vtamobj.png"><img loading="lazy" decoding="async" width="569" height="279" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-delete-vtamobj.png" alt="" class="wp-image-12689" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-delete-vtamobj.png 569w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-delete-vtamobj-300x147.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-dataset-delete-vtamobj-500x245.png 500w" sizes="auto, (max-width: 569px) 100vw, 569px" /></a></figure>



<p class="wp-block-paragraph">The files are now gone!  On the next boot they will be rebuilt.</p>



<p class="wp-block-paragraph">I just hit F3 a bunch of times and it&#8217;ll drop to some TSO shell</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="566" height="79" src="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-tso-shell.png" alt="" class="wp-image-12690" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-tso-shell.png 566w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-tso-shell-300x42.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/tk4-tso-shell-500x70.png 500w" sizes="auto, (max-width: 566px) 100vw, 566px" /></figure>



<p class="wp-block-paragraph">From here you can shutdown the system.  It&#8217;ll take a few minutes, but you can start it up again just the same way you brought it up.  Remember to attach your console.</p>



<h2 class="wp-block-heading">Setting up SNA Server</h2>



<p class="wp-block-paragraph">Just like Dynamips, I setup a batch file, as the default one is just far too long to read:</p>



<pre class="wp-block-code"><code>@echo you need to figure out your nic name..
@echo something like
@echo \Device\NPF_{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
set loopback=\Device\NPF_{3DF0EC5D-7FBE-46DF-ACF8-EF5D8679A473}
set vmnet1=\Device\NPF_{3BC364F4-5A15-405D-926C-C594383F0323}
qemu -m 64 -L pc-bios ^
-hda SBS15.vmdk ^
-soundhw sb16,adlib ^
-net nic,model=pcnet,macaddr=52:24:00:22:00:01 ^
-net pcap,devicename=%loopback% ^
%1 %2 %3 %4 %5 %6</code></pre>



<p class="wp-block-paragraph">This will setup a small machine with 64MB of ram, a single AMD PCNet adapter on the loopback interface.  I installed Windows NT 3.51 from the Small Business Server 1.5 setup.  I don&#8217;t know why VMware + NT 3.51 didn&#8217;t get along, maybe it&#8217;s my Erying, Or maybe it just plain doesn&#8217;t work, I&#8217;m not sure, and far too impatient to troubleshoot it.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-dlc-protocol.png"><img loading="lazy" decoding="async" width="532" height="355" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-dlc-protocol.png" alt="" class="wp-image-12692" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-dlc-protocol.png 532w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-dlc-protocol-300x200.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-dlc-protocol-450x300.png 450w" sizes="auto, (max-width: 532px) 100vw, 532px" /></a></figure>
</div>


<p class="wp-block-paragraph">It&#8217;s very important that you do add the DLC Protocol during setup.  It&#8217;s in the &#8216;Add Software&#8217; part.  I kept my NT very simple with only NetBEUI and DLC protocols.  At the moment I&#8217;m not that interested in actually networking the NT, and if I was, I would add a second NIC, just like what I did for Dynamips.</p>



<p class="wp-block-paragraph">Setting up NT isn&#8217;t that interesting, but SNA server is.  I did use the 2.11 on the Back Office CD, but for completeness sake of testing I tried the oldest one I could find, and 2.1 beta from June, Build 2.1.0.216. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-properties.png"><img loading="lazy" decoding="async" width="477" height="324" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-properties.png" alt="" class="wp-image-12693" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-properties.png 477w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-properties-300x204.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-properties-442x300.png 442w" sizes="auto, (max-width: 477px) 100vw, 477px" /></a></figure>
</div>


<p class="wp-block-paragraph">I left the network name &amp; control point name blank as I just want terminal, I&#8217;m not even going to think that LU6.2 applications on such an ancient version of MVS was even possible.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/SNA-server-connecton-properties.png"><img loading="lazy" decoding="async" width="483" height="247" src="https://virtuallyfun.com/wp-content/uploads/2023/05/SNA-server-connecton-properties.png" alt="" class="wp-image-12694" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/SNA-server-connecton-properties.png 483w, https://virtuallyfun.com/wp-content/uploads/2023/05/SNA-server-connecton-properties-300x153.png 300w" sizes="auto, (max-width: 483px) 100vw, 483px" /></a></figure>
</div>


<p class="wp-block-paragraph">This is pretty much default, the Link service basically sets itself up as we only have the one NIC.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-802.2-properties.png"><img loading="lazy" decoding="async" width="368" height="422" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-802.2-properties.png" alt="" class="wp-image-12695" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-802.2-properties.png 368w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-802.2-properties-262x300.png 262w" sizes="auto, (max-width: 368px) 100vw, 368px" /></a></figure>
</div>


<p class="wp-block-paragraph">Take note of the remote network address.  400010200100 which came from above the address we directly point to the dlsw.  Also it&#8217;s form the 9track blog.</p>



<p class="wp-block-paragraph">Insert a 3270 LU for us to try to talk to Hercules.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-insert-terminal.png"><img loading="lazy" decoding="async" width="276" height="263" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-insert-terminal.png" alt="" class="wp-image-12696"/></a></figure>
</div>


<p class="wp-block-paragraph">I&#8217;m pretty sure it was hard coded to be a model 2.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-LU-terminal-properties.png"><img loading="lazy" decoding="async" width="329" height="293" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-LU-terminal-properties.png" alt="" class="wp-image-12697" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-LU-terminal-properties.png 329w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-LU-terminal-properties-300x267.png 300w" sizes="auto, (max-width: 329px) 100vw, 329px" /></a></figure>
</div>


<p class="wp-block-paragraph">I turned off the ability for the model to be overwitten.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-create-pool-and-add-terminal.png"><img loading="lazy" decoding="async" width="509" height="228" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-create-pool-and-add-terminal.png" alt="" class="wp-image-12698" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-create-pool-and-add-terminal.png 509w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-create-pool-and-add-terminal-300x134.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-create-pool-and-add-terminal-500x224.png 500w" sizes="auto, (max-width: 509px) 100vw, 509px" /></a></figure>
</div>


<p class="wp-block-paragraph">Create a pool, I called it swimming, because of &#8216;reasons&#8217;.  I made it a type 2 pool and added the terminal to it.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-users-and-groups.png"><img loading="lazy" decoding="async" width="515" height="226" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-users-and-groups.png" alt="" class="wp-image-12699" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-users-and-groups.png 515w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-users-and-groups-300x132.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-users-and-groups-500x219.png 500w" sizes="auto, (max-width: 515px) 100vw, 515px" /></a></figure>
</div>


<p class="wp-block-paragraph">Next I added the EVERYONE user, and gave them access to the SWIMMING pool</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-start-the-service.png"><img loading="lazy" decoding="async" width="604" height="237" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-start-the-service.png" alt="" class="wp-image-12700" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-start-the-service.png 604w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-start-the-service-300x118.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-start-the-service-500x196.png 500w" sizes="auto, (max-width: 604px) 100vw, 604px" /></a></figure>
</div>


<p class="wp-block-paragraph">Finally we are ready to save the config, and do the hand holding and start up.  If the stars aligned you will see them go ACTIVE/ACTIVE and the terminal will go Available.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-terminal-stuck-in-sscp.png"><img loading="lazy" decoding="async" width="614" height="458" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-terminal-stuck-in-sscp.png" alt="" class="wp-image-12701" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-terminal-stuck-in-sscp.png 614w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-terminal-stuck-in-sscp-300x224.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-server-terminal-stuck-in-sscp-402x300.png 402w" sizes="auto, (max-width: 614px) 100vw, 614px" /></a></figure>
</div>


<p class="wp-block-paragraph">Sadly the terminal won&#8217;t go live, it&#8217;s stuck in SSCP. </p>



<p class="wp-block-paragraph">And this is as far as I can go.  I have to think that with either something far older protocol wise for the PC, such as IBM Personal Communications/3270 for Windows V2.0 (v4 didnt work either), or a far newer Mainframe software version would support whatever it is SNA server wants to give us the crazy dream of running SNA self contained.</p>



<p class="wp-block-paragraph">Running Wireshark on the loopback network I see this message:</p>



<figure class="wp-block-image size-large"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function.png"><img loading="lazy" decoding="async" width="1024" height="223" src="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-1024x223.png" alt="" class="wp-image-12702" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-1024x223.png 1024w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-300x65.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-768x167.png 768w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-1536x335.png 1536w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function-500x109.png 500w, https://virtuallyfun.com/wp-content/uploads/2023/05/sna-unsupported-function.png 1629w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="has-text-align-right wp-block-paragraph">UNSUPPORTED FUNCTION</p>



<p class="wp-block-paragraph">Sadly this is as far as I can take you.  I do want to give a special thanks to Vinatron &amp; blackbit for trying to troubleshoot this with me.  Best we can figure is that TK4- is just too old.</p>



<h2 class="wp-block-heading">Troubleshooting</h2>



<p class="wp-block-paragraph">From the cisco router try dlsw commands like this:</p>



<pre class="wp-block-code"><code>dlsw&gt;sho dlsw circuits
Index           local addr(lsap)    remote addr(dsap)  state          uptime
2281701660      4a24.0044.0080(04)  0200.9099.8000(04) CONNECTED      00:02:23
Total number of circuits connected: 1
</code></pre>



<p class="wp-block-paragraph">This does show the connection.  Notice that &#8216;show bridge&#8217; will show nothing in this config.</p>



<p class="wp-block-paragraph">Be sure to check peers as well:</p>



<pre class="wp-block-code"><code>dlsw&gt;show dlsw peers
Peers:                state     pkts_rx   pkts_tx  type  drops ckts TCP   uptime
 TCP 192.168.199.1   CONNECT         10        13  conf      0    1   0 00:05:07
Total number of connected peers: 1
Total number of connections:     1</code></pre>



<p class="wp-block-paragraph">Make sure your interfaces are &#8216;up/up&#8217; and passing traffic</p>



<pre class="wp-block-code"><code>FastEthernet0/0 is up, line protocol is up
  Hardware is DEC21140, address is ca00.48f4.0000 (bia ca00.48f4.0000)
  Internet address is 192.168.199.10/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Half-duplex, 100Mb/s, 100BaseTX/FX
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 1000 bits/sec, 2 packets/sec
  5 minute output rate 2000 bits/sec, 2 packets/sec
     12768 packets input, 1439279 bytes
     Received 3609 broadcasts (0 IP multicast)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog
     0 input packets with dribble condition detected
     9999 packets output, 1037736 bytes, 0 underruns
     0 output errors, 0 collisions, 1 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
dlsw&gt;show int eth1/0
Ethernet1/0 is up, line protocol is up
  Hardware is AmdP2, address is ca00.48f4.001c (bia ca00.48f4.001c)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:02, output 00:00:02, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     52426 packets input, 5148287 bytes, 0 no buffer
     Received 12336 broadcasts (0 IP multicast)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 input packets with dribble condition detected
     36383 packets output, 2465490 bytes, 0 underruns
     0 output errors, 0 collisions, 3 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
dlsw&gt;</code></pre>



<p class="wp-block-paragraph">And of course check WireShark to see if there is any handshake:</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake.png"><img loading="lazy" decoding="async" width="1024" height="472" src="https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake-1024x472.png" alt="" class="wp-image-12703" srcset="https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake-1024x472.png 1024w, https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake-300x138.png 300w, https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake-768x354.png 768w, https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake-500x230.png 500w, https://virtuallyfun.com/wp-content/uploads/2023/05/wireshark-handshake.png 1522w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
</div>


<p class="wp-block-paragraph">And of course check the Hercules logs to make sure your VTAM rebuilt, look for ERROR or anything related to S3705 or N13.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2023/05/26/ghosts-in-the-mainframe/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title>Added UDP to Qemu0.90</title>
		<link>https://virtuallyfun.com/2019/03/18/added-udp-to-qemu0-90/</link>
					<comments>https://virtuallyfun.com/2019/03/18/added-udp-to-qemu0-90/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Mon, 18 Mar 2019 12:28:31 +0000</pubDate>
				<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[SLiRP]]></category>
		<category><![CDATA[virtual networking]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/wordpress/?p=9286</guid>

					<description><![CDATA[Yes, I know it&#8217;s kinda pointless as it&#8217;s horribly out of date, but I&#8217;m still having fun. Anyways now it&#8217;ll integrate with dynamips! So yeah, in this example, instead of the usual &#8220;-net user&#8221; and the built in SLiRP stack, &#8230; <a href="https://virtuallyfun.com/2019/03/18/added-udp-to-qemu0-90/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Yes, I know it&#8217;s kinda pointless as it&#8217;s horribly out of date, but I&#8217;m still having fun.  Anyways now it&#8217;ll integrate with <a href="https://sourceforge.net/projects/dynamips-mingw/">dynamips</a>!</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="978" height="696" src="https://virtuallyfun.com/wp-content/uploads/2019/03/Qemu090-with-UDP-packet-networking.png" alt="" class="wp-image-9287" srcset="https://virtuallyfun.com/wp-content/uploads/2019/03/Qemu090-with-UDP-packet-networking.png 978w, https://virtuallyfun.com/wp-content/uploads/2019/03/Qemu090-with-UDP-packet-networking-300x213.png 300w, https://virtuallyfun.com/wp-content/uploads/2019/03/Qemu090-with-UDP-packet-networking-768x547.png 768w" sizes="auto, (max-width: 978px) 100vw, 978px" /></figure>



<p class="wp-block-paragraph">So yeah, in this example, instead of the usual &#8220;-net user&#8221; and the built in SLiRP stack, this uses UDP to talk to a stand-alone SLiRP stack.  This will let you plug your Qemu into virtual Ethernet switches/hubs and interfaces of virtual routers.  Even mixing and matching connections to different emulators that use UDP to exchange packets.</p>



<p class="wp-block-paragraph">In this case I have a VMDK loaded with a NE2K-PCI driver, and QuakeWorld for MS-DOS.  I also made the MPU401 external although it&#8217;s hanging on a secondary flag&#8230;</p>



<p class="wp-block-paragraph">qemu.exe -L pc-bios -m 64 -soundhw sb16,adlib -mpu401 xx -net nic,model=ne2k_pci -net socket,udp=127.0.0.1:4000,remote=127.0.0.1:4001 -hda qworld.vmdk</p>



<p class="wp-block-paragraph">This has the Qemu instance listen on UDP port 4000, and connect to the same physical host on port 4001.</p>



<p class="wp-block-paragraph">The recipical for the SLiRP stack from my bashed Dynamips is:</p>



<p class="wp-block-paragraph">slirp_rdr.exe 4001 127.0.0.1 4000</p>



<p class="wp-block-paragraph">Which in this case listens on port 4001, and connects back on port 4000.</p>



<p class="wp-block-paragraph">Hopefully it makes some sense to someone.</p>



<p class="wp-block-paragraph">Download it, if you want!</p>



<a href="https://sourceforge.net/projects/qemu090b/files/latest/download"><img decoding="async" alt="Download Qemu090b" src="https://a.fsdn.com/con/app/sf-download-button" width=276 height=48 srcset="https://a.fsdn.com/con/app/sf-download-button?button_size=2x 2x"></a>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2019/03/18/added-udp-to-qemu0-90/feed/</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
		<item>
		<title>4.3BSD syslogd for Windows</title>
		<link>https://virtuallyfun.com/2017/04/13/4-3bsd-syslogd-windows/</link>
					<comments>https://virtuallyfun.com/2017/04/13/4-3bsd-syslogd-windows/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 05:33:02 +0000</pubDate>
				<category><![CDATA[4.3 BSD]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[cisco networking]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[Win32]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7046</guid>

					<description><![CDATA[Continuing from my TACACS adventure, I also thought it would be nice to capture syslogs, and save them. Oddly enough this is a big business, with even low end products like Kiwi Syslog server costing some $295 USD! Well that&#8217;s &#8230; <a href="https://virtuallyfun.com/2017/04/13/4-3bsd-syslogd-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Continuing from my <a href="https://virtuallyfun.com/2017/04/13/tacacs-for-windows/">TACACS adventure</a>, I also thought it would be nice to capture syslogs, and save them. Oddly enough this is a big business, with even low end products like <a href="http://www.kiwisyslog.com/products/kiwi-syslog-server/product-overview.aspx">Kiwi Syslog server</a> costing some $295 USD!</p>
<p>Well that&#8217;s too much for me, so I figured that the most wide spread at the time must have been the <a href="http://unix.superglobalmegacorp.com/cgi-bin/cvsweb.cgi/CSRG/etc/syslogd.c?rev=1.1.1.1;cvsroot=4.3%20BSD;only_with_tag=MAIN">4.3BSD syslogd</a>, so I&#8217;ll start with that.</p>
<p>Just as before this was a pretty straight forward port, I had to remove all the /dev/kmem and UNIX socket stuff, as they obviously don&#8217;t exist on Windows. Â Just as the same, you can&#8217;t &#8220;write to users&#8221; to send messages, so by default output is a file. Â I suppose I could use the net send functionality to pop up a message, but I find it just as annoying today as it was then.</p>
<p>At any rate in no time I was able to setup a simple config file, and then get my router to turn on full logging &amp; enable full debugging to get a continuous stream of messages. Â The only &#8216;gotcha&#8217; is that this sylogd wants to be able to do reverse lookups, so you really ought to have a DNS with reverse entries, or a good hosts file.</p>
<pre>syslogd_win32 -d
off &amp; running....
init
cfline(*.emerg;*.alert;*.crit;*.err;*.warning;*.notice;*.info;*.debug   log.txt)
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 X FILE: log.txt
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UNUSED:
logmsg: pri 56, flags 8, from jaderabbit, msg syslogd: restart
Logging to FILE log.txt
syslogd: restarted
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2458: 00:24:19: SNMP: HC Timer 619E3D1C fired
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2459: 00:24:19: SNMP: HC Timer 619E3D1C rearmed, delay = 5000
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2460: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2461: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2462: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2463: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2464: 00:24:22: SNMP: HC Timer 61875370 fired
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2465: 00:24:22: SNMP: HC Timer 61875370 rearmed, delay = 20000
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2466: 00:24:22: IP: s=192.168.254.1 (FastEthernet0/0), d=192.168.254.255 (FastEthernet0/0), len 159, rcvd 3
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2467: 00:24:22: UDP: rcvd src=192.168.254.1(17500), dst=192.168.254.255(17500), length=139
Logging to FILE log.txt
cvthname(192.168.254.10)
logmsg: pri 277, flags 0, from testcisco, msg 2468: 00:24:22: IP: s=192.168.254.1 (FastEthernet0/0), d=192.168.254.255, len 159, dispose udp.noport
Logging to FILE log.txt
</pre>
<p>As you can see, running it in debug mode tells me what is going on. Â And the log.txt file contains a nicely formatted log file, just the way that it was done on BSD:</p>
<pre>Apr 13 13:11:04 jaderabbit syslogd: restart
Apr 13 13:11:17 testcisco 2458: 00:24:19: SNMP: HC Timer 619E3D1C fired
Apr 13 13:11:17 testcisco 2459: 00:24:19: SNMP: HC Timer 619E3D1C rearmed, delay = 5000
Apr 13 13:11:27 testcisco 2460: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Apr 13 13:11:27 testcisco 2461: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Apr 13 13:11:27 testcisco 2462: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Apr 13 13:11:27 testcisco 2463: 00:24:21: IP: s=192.168.254.1 (FastEthernet0/0), d=239.255.255.250, len 202, dispose ip.hopcount
Apr 13 13:11:27 testcisco 2464: 00:24:22: SNMP: HC Timer 61875370 fired
Apr 13 13:11:27 testcisco 2465: 00:24:22: SNMP: HC Timer 61875370 rearmed, delay = 20000
Apr 13 13:11:34 testcisco 2466: 00:24:22: IP: s=192.168.254.1 (FastEthernet0/0), d=192.168.254.255 (FastEthernet0/0), len 159, rcvd 3
Apr 13 13:11:34 testcisco 2467: 00:24:22: UDP: rcvd src=192.168.254.1(17500), dst=192.168.254.255(17500), length=139
Apr 13 13:11:34 testcisco 2468: 00:24:22: IP: s=192.168.254.1 (FastEthernet0/0), d=192.168.254.255, len 159, dispose udp.noport</pre>
<p>&nbsp;</p>
<p>I&#8217;m sure it&#8217;s full of other bugs, but all I tested was that I could log to a file, and it&#8217;s doing that much just fine. Â If you feel so inclined you can download &amp; compile it, the source is: <a href="http://vpsland.superglobalmegacorp.com/install/Cisco/syslogd_win32.c">syslogd_win32.c</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/04/13/4-3bsd-syslogd-windows/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>TACACS for Windows</title>
		<link>https://virtuallyfun.com/2017/04/13/tacacs-for-windows/</link>
					<comments>https://virtuallyfun.com/2017/04/13/tacacs-for-windows/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 02:58:44 +0000</pubDate>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[cisco networking]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[virtual networking]]></category>
		<category><![CDATA[Win32]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=7031</guid>

					<description><![CDATA[So, in my fun and excitement I was putting together a &#8216;cisco&#8217; network using dynamips that spans a few sites across the world. Â I&#8217;m using ancient copies of NT for some servers, although I plan on adding in some 386BSD, &#8230; <a href="https://virtuallyfun.com/2017/04/13/tacacs-for-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>So, in my fun and excitement I was putting together a &#8216;cisco&#8217; network using dynamips that spans a few sites across the world. Â I&#8217;m using ancient copies of NT for some servers, although I plan on adding in some 386BSD, SunOS SPARC, and maybe even 68010 based, along with other stuff.</p>
<p>I have the routers running fine, but I felt like adding some kind of external authentication service, and <a href="https://en.wikipedia.org/wiki/TACACS">TACACS</a> certainly fits the bill! Â And to be all vintage as usual, I&#8217;m not going to use TACACS+ as it&#8217;s simply too new, and too big. Â So first things first, I need a copy of the source to TACACS as I&#8217;m certainly not going to write my own! Â I found <a href="http://ftp.funet.fi/pub/netinfo/old/cisco/">this directory on ftp.funet.fi</a> which has a bunch of old cisco related material, and sure enough there is a <a href="http://ftp.funet.fi/pub/netinfo/old/cisco/tacacsd.c">tacacsd.c</a></p>
<p>Even better it&#8217;s from 1989 which suits my need for something positively ancient, and simple enough to be a single C file.</p>
<pre>/*
 * TACACS daemon suitable for using on Un*x systems.
 *
 * Janruary 1989, Greg Satz
 *
 * Copyright (c) 1989 by cisco Systems, Inc.
 * All rights reserved.
 */</pre>
<p>Porting it to run on Winsock, really wasn&#8217;t all that hard, I had it running as a standalone program within a few minutes, however there is no password file in NT, so as a simple test, I had simply short circutied the username lookup to always suceeded, along with a password compare.</p>
<p>Since I have VMWare Player installed on my machine, I can use the VMNet 8 connection to talk to my host computer. Â The hard part of course is trying to figure out which NIC is which, but dynamips -e will give you a list like this:</p>
<pre>Cisco Router Simulation Platform (version 0.2.16-experimental(merge uppc smips)Build-1-x86/MinGW stable)
Copyright (c) 2005-2011 Christophe Fillot.
Build date: Dec 15 2016 04:20:41

Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]
Network device list:

   \Device\NPF_{D3DF08C4-7A33-4FE2-9351-000153705A30} : VMware Virtual Ethernet Adapter
   \Device\NPF_{3FB194EF-F3A4-45F2-AFAB-A4ABA98E8FF7} : Qualcomm Atheros Ar81xx series PCI-E Ethernet Controller
   \Device\NPF_{C46B48B8-74E1-4938-9BFE-E407949A7940} : Microsoft
   \Device\NPF_{F72C65CD-C6BC-44FE-9019-C5057DB1D9AB} : VMware Virtual Ethernet Adapter
   \Device\NPF_{CE75B9C1-8189-4C8F-8EF6-6CEB0C6D0329} : Microsoft
   \Device\NPF_{737A8B62-9A87-4739-9CC2-BF05CDC315D0} : Microsoft</pre>
<p>And with that information, we are good to go! Â Since I&#8217;m doing a simple test here, I don&#8217;t need anything other than a single ethernet to talk to my host, so here is a VERY simple cli to run dynamips:</p>
<p>..\dynamips.exe -P 7200 ..\c7200-is-mz.19991126.bin -t npe-200 -p 0:C7200-IO-FE -s 0:0:gen_eth:\Device\NPF_{D3DF08C4-7A33-4FE2-9351-000153705A30} Â &#8211;idle-pc 0x604f1da0 -X</p>
<p>And I&#8217;m off booting!</p>
<pre>Cisco Router Simulation Platform (version 0.2.16-experimental(merge uppc smips)Build-1-x86/MinGW stable)
Copyright (c) 2005-2011 Christophe Fillot.
Build date: Dec 15 2016 04:20:41

Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]
Idle PC set to 0x604f1da0.
IOS image file: ..\c7200-is-mz.19991126.bin

ILT: loaded table "mips64j" from cache.
ILT: loaded table "mips64e" from cache.
ILT: loaded table "ppc32j" from cache.
ILT: loaded table "ppc32e" from cache.
vtty_term_init
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
C7200 instance 'default' (id 0):
  VM Status  : 0
  RAM size   : 256 Mb
  IOMEM size : 0 Mb
  NVRAM size : 128 Kb
  NPE model  : npe-200
  Midplane   : vxr
  IOS image  : ..\c7200-is-mz.19991126.bin

Loading ELF file '..\c7200-is-mz.19991126.bin'...
ELF entry point: 0x80008000

C7200 'default': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
mips64_test.s ROMMON emulation microcode.

mips64_test.s Launching IOS image at 0x80008000...
Self decompressing the image : ####()## [OK]

              Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706



Cisco Internetwork Operating System Software
IOS (tm) 7200 Software (C7200-IS-M), Experimental Version 12.0(20000110:181554) [otroan-thanksgiving-rel 175]
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Thu 20-Jan-00 15:07 by otroan
Image text-base: 0x60008900, data-base: 0x613D0000

cisco 7206VXR (NPE200) processor with 253952K/8192K bytes of memory.
R5000 CPU at 200Mhz, Implementation 35, Rev 1.2
6 slot VXR midplane, Version 2.1

Last reset from power-on
Bridging software.
X.25 software, Version 3.0.0.
1 FastEthernet/IEEE 802.3 interface(s)
125K bytes of non-volatile configuration memory.
4096K bytes of packet SRAM memory.

65536K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes).
8192K bytes of Flash internal SIMM (Sector size 256K).

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: no


Press RETURN to get started!
</pre>
<p>Next I need to take note of how VMWare &amp; Windows have configured my VMNet8 adapter, and configure the router accordingly:</p>
<pre>Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::fcd4:2983:bcba:2d63%19
   IPv4 Address. . . . . . . . . . . : 192.168.254.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :</pre>
<p>So Im using 192.168.254.1/24 so let&#8217;s setup the router. Â Let&#8217;s give it a .10 for the heck of it. Â Also I&#8217;m going to turn off DNS name resolution for the moment.</p>
<pre>00:00:02: %DEC21140-3-DUPLEX_SPEED: FastEthernet0/0 doesn't support the configured duplexand speed combination
00:00:02: %DEC21140-3-DUPLEX_SPEED: FastEthernet0/0 doesn't support the configured duplexand speed combination
00:00:02: %DEC21140-3-DUPLEX_SPEED: FastEthernet0/0 doesn't support the configured duplexand speed combination
00:00:32: %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down
00:00:32: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating Sys
Router&gt;
Router&gt;tem Software
IOS (tm) 7200 Software (C7200-IS-M), Experimental Version 12.0(20000110:181554) [otroan-thanksgiving-rel 175]
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Thu 20-Jan-00 15:07 by otroan
00:00:33: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
Router&gt;ena
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#ip address 192.168.254.10 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.254.1
00:01:29: %DEC21140-3-DUPLEX_SPEED: FastEthernet0/0 doesn't support the configured duplexand speed combination 
00:01:31: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
00:01:32: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config)#no ip domain-lookup
Router(config)#exit
Router#wr
Building configuration...
[OK]
Router#
00:01:39: %SYS-5-CONFIG_I: Configured from console by console
</pre>
<p>And if everything is going well, I can now ping from Windows!</p>
<pre>Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\neozeed&gt;ping 192.168.254.10

Pinging 192.168.254.10 with 32 bytes of data:
Reply from 192.168.254.10: bytes=32 time=54ms TTL=255
Reply from 192.168.254.10: bytes=32 time=31ms TTL=255
Reply from 192.168.254.10: bytes=32 time=31ms TTL=255
Reply from 192.168.254.10: bytes=32 time=31ms TTL=255

Ping statistics for 192.168.254.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 31ms, Maximum = 54ms, Average = 36ms

C:\Users\neozeed&gt;</pre>
<p>Awesome! Â Pinging from the cisco however fails.</p>
<pre>Router#ping 192.168.254.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.254.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
</pre>
<p>This fails as Windows by default has it&#8217;s firewall on, which then blocks all incoming traffic. However to see that the ICMP would have succeded, you can look at the arp table, and the .1 address should have been learned:</p>
<pre>Router#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.254.1           0   0050.56c0.0008  ARPA   FastEthernet0/0
Internet  192.168.254.10          -   ca00.3730.0000  ARPA   FastEthernet0/0
</pre>
<p>We can either diable the firewall, or we can add a rule to permit ICMP. To do either you need to go to the firewall control panel in Windows. Â In this quick example, I&#8217;m going to build a rule using the firewall control pannel.</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/firewall-control-pannel.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7037" src="https://virtuallyfun.com/wp-content/uploads/2017/04/firewall-control-pannel.png" alt="" width="1125" height="634" /></a></p>
<p>So hit the advancedÂ settings to the left.</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/firewall-advanced.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7038" src="https://virtuallyfun.com/wp-content/uploads/2017/04/firewall-advanced.png" alt="" width="1047" height="784" /></a></p>
<p>Click on the &#8216;Inbound Rules&#8217;, and now we are going to create a new rule.</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-1.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7033" src="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-1.png" alt="" width="714" height="581" /></a></p>
<p>Select a Custom Rule</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/network-2b.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7040" src="https://virtuallyfun.com/wp-content/uploads/2017/04/network-2b.png" alt="" width="714" height="581" /></a></p>
<p>Allow &#8216;All Programs&#8217;</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/network-2c.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7041" src="https://virtuallyfun.com/wp-content/uploads/2017/04/network-2c.png" alt="" width="714" height="581" /></a></p>
<p>Then set the protocol to ICMPv4</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-2.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7034" src="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-2.png" alt="" width="714" height="581" /></a></p>
<p>Now we can select the scope of the rule, in this case we are going to allow the 192.168.254.0/24 network to pass icmp traffic to us. Â Add it as a source and destination.</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-4.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7036" src="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-4.png" alt="" width="714" height="581" /></a></p>
<p>In this quick example I&#8217;m applying it everywhere. Â I suppose a better Â setup would be to make sure the VMNet 8 adapter is a &#8216;Private&#8217; network, and ONLY apply this to the Private domain.</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-5.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7032" src="https://virtuallyfun.com/wp-content/uploads/2017/04/build-firewall-rule-5.png" alt="" width="714" height="581" /></a></p>
<p>Then give it a name, something like &#8216;ICMP for VMnet8&#8217;</p>
<pre>Router#ping 192.168.254.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.254.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/30/36 ms
</pre>
<p>And now we can ping!</p>
<p>Now for the fun, I go ahead and compile my hacked up tacacsd.c, and run it, and then permit it to run on all networks:</p>
<p><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/tacacsd-permissions.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7042" src="https://virtuallyfun.com/wp-content/uploads/2017/04/tacacsd-permissions.png" alt="" width="527" height="381" /></a></p>
<p>And now I can configure the router to use TACACS. Â Keep in mind, once gain that this is *NOT* TACACS+ so this is done a little differently. Â I&#8217;m going to simply set TACACS for telnet connections.</p>
<pre>Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#tacacs-server host 192.168.254.1
Router(config)#line vty 0 4
Router(config-line)#login tacacs
Router(config-line)#exit
Router(config)#enable password 0 cisco
Router(config)#exit
Router#wr
Building configuration...
[OK]
Router#
00:01:28: %SYS-5-CONFIG_I: Configured from console by console</pre>
<p>And now I&#8217;m ready to test!</p>
<pre>User Access Verification

Username: user
Password:
Router&gt;who
    Line       User       Host(s)              Idle       Location
   0 con 0                idle                 00:01:11
*  2 vty 0     user       idle                 00:00:00 192.168.254.1

  Interface  User      Mode                     Idle Peer Address

Router&gt;</pre>
<p>As you can see I logged in as &#8216;user&#8217; &#8230; and keep in mind my TACACS simply permits anything. As for what tacacsd runs by default:</p>
<pre>D:\dynamips\tacacs&gt;tacacsd.exe
server starting
using port 12544
validation request from 192.168.254.10
query for user (pw-&gt;pw_gecos) accepted</pre>
<p>It&#8217;s not exciting, but as you can see it is attempting to look through the <a href="https://en.wikipedia.org/wiki/Gecos_field">gecos</a>Â to verify the user, but in this case I just allow anything. Â And besides just granting anyone the ability to login, let&#8217;s take a look on the wire:</p>
<p><div id="attachment_7044" style="width: 963px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/wireshark-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7044" class="wp-image-7044 size-full" src="https://virtuallyfun.com/wp-content/uploads/2017/04/wireshark-1.png" alt="" width="953" height="544" /></a><p id="caption-attachment-7044" class="wp-caption-text">WireShark capture of TACACS traffic</p></div></p>
<p>As you can see the username &amp; password go over the wire in plain text. Â Even the response is simple enough to decode:</p>
<p><div id="attachment_7043" style="width: 858px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2017/04/wireshark-2.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7043" class="size-full wp-image-7043" src="https://virtuallyfun.com/wp-content/uploads/2017/04/wireshark-2.png" alt="" width="848" height="491" /></a><p id="caption-attachment-7043" class="wp-caption-text">Access granted!</p></div></p>
<p>Needless to say this is something that you would NEVER EVER EVER run in a real network. Â Of course a system that sits on telnet is vulnerable anyways, but I suppose a TACACS server that lets anyone log in, makes either a VERY trusting network, or a good honeypot. Â Against my better judgement, here isÂ <a href="http://vpsland.superglobalmegacorp.com/install/Cisco/tacacsd_win32.c">tacacsd_win32.c</a>Â  Naturally it could be easily made to verify passwords against pretty much anything.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2017/04/13/tacacs-for-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dynamips 0.2.16 was released over on github</title>
		<link>https://virtuallyfun.com/2016/04/08/dynamips-0-2-16-was-released-over-on-github/</link>
					<comments>https://virtuallyfun.com/2016/04/08/dynamips-0-2-16-was-released-over-on-github/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 08 Apr 2016 00:38:07 +0000</pubDate>
				<category><![CDATA[Dynamips]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=6039</guid>

					<description><![CDATA[Since there has been an update over on the github project, I thought this was a good time to take my existing port, and basically dump it, and make it integrate a lot better. Â So this time I did a &#8230; <a href="https://virtuallyfun.com/2016/04/08/dynamips-0-2-16-was-released-over-on-github/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Since there has been an update over on the <a href="https://github.com/GNS3/dynamips">github</a> project, I thought this was a good time to take my existing port, and basically dump it, and make it integrate a lot better. Â So this time I did a lot of #ifdef&#8217;ing and the code should still compile on UNIX like systems.</p>
<p>I need to go through all the reboot/reload scenarios an try to either find out why it crashes, or just comment out dangerous paths.</p>
<p>So yes there is a good chance on a reload it&#8217;ll crash right now.</p>
<p>I also had issues with the new vty code, so I&#8217;m still using the old file from an ancient version of dynamips thatÂ I seem to have massaged well enough to behave for a primative console at the command prompt.</p>
<p>I put it on <a href="https://sourceforge.net/projects/dynamips-mingw/">Sourceforge</a>, because I&#8217;m rebellious like that.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2016/04/08/dynamips-0-2-16-was-released-over-on-github/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>InfoTaskForce running on PowerPC (Dynamips)</title>
		<link>https://virtuallyfun.com/2015/09/27/infotaskforce-running-on-powerpc-dynamips/</link>
					<comments>https://virtuallyfun.com/2015/09/27/infotaskforce-running-on-powerpc-dynamips/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Sat, 26 Sep 2015 19:19:48 +0000</pubDate>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[Infocom]]></category>
		<category><![CDATA[powerpc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=5552</guid>

					<description><![CDATA[Well considering what a hit it was, the last time I did this, I thought I&#8217;d give it another go! And after a bit of fighting, I got it to run! Now what were the obstacles? Â Well for starters not &#8230; <a href="https://virtuallyfun.com/2015/09/27/infotaskforce-running-on-powerpc-dynamips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_5553" style="width: 669px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2015/09/PowerPC-expanded-cilo.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5553" class="size-full wp-image-5553" src="https://virtuallyfun.com/wp-content/uploads/2015/09/PowerPC-expanded-cilo.png" alt="choices.." width="659" height="334" /></a><p id="caption-attachment-5553" class="wp-caption-text">choices..</p></div></p>
<p>Well considering what a hit it was, <a href="https://virtuallyfun.com/2014/12/15/tracking-down-the-infotaskforce-from-1987/">the last time I did this</a>, I thought I&#8217;d give it another go!</p>
<p>And after a bit of fighting, I got it to run!</p>
<p>Now what were the obstacles? Â Well for starters not having a full libc certainly hurts things. Â Things like a malloc. Â And without getting fancy with the memory map I did the lamest cheat ever, which is a 1MB static array I just handed out with a fake malloc (no free, I didn&#8217;t bother to track chunks), and you know it works enough.</p>
<p>Also I need to read files, and I need to look more into the hardware to see how to do that. Â There seems to be plenty of hooks for NVRAM, but the ROMMON substitute doesn&#8217;t seem to support them. Â Also there is no ROMMON hook for reading from the console! Â The MIPS cilo is more ROMMON dependent, while the PowerPC c1700 talks to the uart directly so this is a PowerPC thing for right now.</p>
<p>I also learned something exciting about ld, which is how it can absorb binary images into objects, that you can link and access directly into your program! Â No more having to convert it to hex, make these insane headders that CPP may or may not bomb over. Â No you can make them objects right away!</p>
<div id="l4" class="code_block" style="padding-left: 30px;">ppc-elf-ld -r -b binary -o planetfa.o planetfa.dat</div>
<p>In this example I read the file planetfa.dat as BINARY, and encapsulate it in an object file called planetfa.o . It&#8217;ll now have a symbol name of _binary_planetfa_dat_start for where the image begins,Â _binary_planetfa_dat_size will tell me how big it is in memory, andÂ _binary_planetfa_dat_end will mark the end of this &#8216;file&#8217; in memory.</p>
<p>Now in the old days when it was a file I could access it like this:</p>
<p style="padding-left: 30px;">fread ((char *)ptr,block_size,(int)num_blocks,game_file);</p>
<p>But that won&#8217;t work. Â So now instead of calling fopen/fclose (which don&#8217;t exist in CILO), I set a counter to what my current offset is, change the &#8216;fseek&#8217; to just set the global counter to where it should be, and when I fread I just memcpy:</p>
<div id="l176" class="code_block" style="padding-left: 30px;"><span class="n">memcpy</span><span class="p">(</span><span class="n">ptr</span><span class="p">,</span><span class="n">_binary_planetfa_dat_start</span><span class="o">+</span><span class="n">fseekp</span><span class="p">,</span><span class="n">num_blocks</span><span class="o">*</span><span class="n">block_size</span><span class="p">);</span></div>
<div id="l177" class="code_block" style="padding-left: 30px;"><span class="n">fseekp</span><span class="o">=</span><span class="n">fseekp</span><span class="o">+</span><span class="p">(</span><span class="n">num_blocks</span><span class="o">*</span><span class="n">block_size</span><span class="p">);</span></div>
<p>I suppose I could just have wrapped the f* calls into some emulation library but I don&#8217;t need to get all that crazy sophisticated.</p>
<div class="code_block" style="padding-left: 30px;">C:\temp\dynamips&gt;dynamips.exe -P 1700 -X -r 4 ciscoload.bin<br />
Cisco Router Simulation Platform (version 0.2.15-experimental(merge uppc smips)Build-3-x86/MinGW stable)<br />
Copyright (c) 2005-2011 Christophe Fillot.<br />
Build date: Sep 19 2015 19:33:12</div>
<p style="padding-left: 30px;">Local UUID: 0450c178-6480-11e5-a559-019031cf957a</p>
<p style="padding-left: 30px;">Pcap version [WinPcap version 4.1.3 (packet.dll version 4.1.0.2980), based on libpcap version 1.0 branch 1_0_rel0b (20091008)]<br />
Unsure if this file (c1700_i0_rommon_vars) needs to be in binary mode<br />
Virtual RAM size set to 4 MB.<br />
IOS image file: ciscoload.bin</p>
<p style="padding-left: 30px;">ILT: loaded table &#8220;mips64j&#8221; from cache.<br />
ILT: loaded table &#8220;mips64e&#8221; from cache.<br />
ILT: loaded table &#8220;ppc32j&#8221; from cache.<br />
ILT: loaded table &#8220;ppc32e&#8221; from cache.<br />
vtty_term_init<br />
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.<br />
C1700 instance &#8216;default&#8217; (id 0):<br />
VM Status : 0<br />
RAM size : 4 Mb<br />
NVRAM size : 32 Kb<br />
IOS image : ciscoload.bin</p>
<p style="padding-left: 30px;">Loading BAT registers<br />
Loading ELF file &#8216;ciscoload.bin&#8217;&#8230;<br />
ELF entry point: 0x8000d9c8</p>
<p style="padding-left: 30px;">C1700 &#8216;default&#8217;: starting simulation (CPU0 IA=0xfff00100), JIT enabled.<br />
ROMMON emulation microcode.</p>
<p style="padding-left: 30px;">Launching IOS image at 0x8000d9c8&#8230;<br />
CILO<br />
CiscoLoader (CILO) &#8211; Linux bootloader for Cisco Routers<br />
Available RAM: 4096 kB<br />
Available commands:<br />
queen<br />
hanoi<br />
horse<br />
fib<br />
planetfall<br />
halt</p>
<p style="padding-left: 30px;">Enter filename to boot:<br />
malloc 64512 offset is 0 offset is now 64522<br />
malloc 38912 offset is 64522 offset is now 103444<br />
PLANETFALL<br />
Infocom interactive fiction &#8211; a science fiction story<br />
Copyright (c) 1983 by Infocom, Inc. All rights reserved.<br />
PLANETFALL is a trademark of Infocom, Inc.<br />
Release 37 / Serial number 851003</p>
<p style="padding-left: 30px;">Another routine day of drudgery aboard the Stellar Patrol Ship Feinstein. This<br />
morning&#8217;s assignment for a certain lowly Ensign Seventh Class: scrubbing the<br />
filthy metal deck at the port end of Level Nine. With your Patrol-issue<br />
self-contained multi-purpose all-weather scrub brush you shine the floor with a<br />
diligence born of the knowledge that at any moment dreaded Ensign First Class<br />
Blather, the bane of your shipboard existence, could appear.</p>
<p style="padding-left: 30px;">Deck Nine<br />
This is a featureless corridor similar to every other corridor on the ship. It<br />
curves away to starboard, and a gangway leads up. To port is the entrance to<br />
one of the ship&#8217;s primary escape pods. The pod bulkhead is closed.</p>
<p style="padding-left: 30px;">Deck Nine Score: 0/4451<br />
PLANETFALL<br />
Infocom interactive fiction &#8211; a science fiction story<br />
Copyright (c) 1983 by Infocom, Inc. All rights reserved.<br />
PLANETFALL is a trademark of Infocom, Inc.<br />
Release 37 / Serial number 851003</p>
<p style="padding-left: 30px;">Deck Nine Score: 0/4451<br />
&gt;</p>
<p>For anyone crazy enough, you can find my <a href="https://sourceforge.net/p/dynamips-mingw/">MinGW Dynamips on sourceforge</a>, <a href="https://sourceforge.net/projects/dynamips-mingw/files/PowerPC-ELF%20cross%20compilers/">cross compilers for PowerPC</a>, and <a href="https://sourceforge.net/p/dynamips-mingw/code/ci/firmware-test/tree/InfoTaskforce/">the branch of the firmware source</a> that includes <a href="http://www.planetemu.net/rom/tandy-radio-shack-trs-80-model-1/infocom-adventure-executor-source-files-1987-infotaskforce-c">InfoTaskForce</a>, and <a href="https://sourceforge.net/p/dynamips-mingw/code/ci/firmware-test/tree/InfoTaskforce/ciscoload.bin?format=raw">the binary image</a>.</p>
<p>While I don&#8217;t want to write an OS for this, it is almost tempting. Â Or go the other route, and add in some non router based hardware&#8230; Like audio hardware, or a framebuffer.</p>
<p>Does anyone have a 1700 to test to see if any of this works? Â Or a 7200?! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2015/09/27/infotaskforce-running-on-powerpc-dynamips/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>Continuing with a PowerPC ELF compiler for Windows</title>
		<link>https://virtuallyfun.com/2015/09/25/continuing-with-a-powerpc-elf-compiler-for-windows/</link>
					<comments>https://virtuallyfun.com/2015/09/25/continuing-with-a-powerpc-elf-compiler-for-windows/#respond</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 25 Sep 2015 02:26:11 +0000</pubDate>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[powerpc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=5546</guid>

					<description><![CDATA[Continuing on from yesterdays adventure I built the PowerPC compiler to support the Cisco 1700 (and maybe the 7200 NPE-G2?). Much to my surprise, this one works too! Loading ELF file &#8216;../ciscoload.bin&#8217;&#8230; ELF entry point: 0x8000cba0 C1700 &#8216;default&#8217;: starting simulation &#8230; <a href="https://virtuallyfun.com/2015/09/25/continuing-with-a-powerpc-elf-compiler-for-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Continuing on from <a href="https://virtuallyfun.com/2015/09/24/building-a-mips-compiler-for-windows-on-a-linux-vm/">yesterdays adventure</a> I built the PowerPC compiler to support the Cisco 1700 (and maybe the 7200 NPE-G2?).</p>



<p class="wp-block-paragraph">Much to my surprise, this one works too!</p>



<p class="wp-block-paragraph">Loading ELF file &#8216;../ciscoload.bin&#8217;&#8230;<br>
ELF entry point: 0x8000cba0</p>



<p class="wp-block-paragraph">C1700 &#8216;default&#8217;: starting simulation (CPU0 IA=0xfff00100), JIT enabled.<br>
ROMMON emulation microcode.</p>



<p class="wp-block-paragraph">Launching IOS image at 0x8000cba0&#8230;<br>
CIL<br>
Error: Unable to find any valid flash! Aborting load.</p>



<p class="wp-block-paragraph">Awesome!</p>



<p class="wp-block-paragraph">Building this was a lot more fun.  I thought I could sidestep building a Linux to PowerPC ELF cross compiler, but as it turns out, to bootstrap libgcc, you really need a compiler that can do this.  But with the steps basically down, it was trivial to whip up.</p>



<p class="wp-block-paragraph">Although I did keep on hitting this error with the Win32 tools that&nbsp;&#8220;-mstrict-align&#8221; is not supported, while trying to build the startup and libgcc sources using the MinGW targeted compiler through wine. &nbsp;But once I had a native Linux to PowerPC toolchain in place, not only could I build the Windows based compiler, but I can also use the flag -mstrict-align on Windows without it complaining. &nbsp;So lesson learned, have a cross compiler built to the final target to make life easier when building a Canadian cross.</p>



<p class="wp-block-paragraph">As always, building the binutils package was a snap, just run:</p>



<p class="wp-block-paragraph"><code>./configure --host=i686-mingw32 --target=ppc-elf -prefix=/ppc</code></p>



<p class="wp-block-paragraph">and I had my assembler/linker/librarian in no time.</p>



<p class="wp-block-paragraph">Because of the aforementioned -mstrict-align issue, I got more creative with the parameters for GCC.</p>



<p class="wp-block-paragraph"><code>./configure --target=ppc-elf --prefix=/ppc --disable-nls --disable-werror --disable-libssp --without-headers --disable-threads --build=i486-linux-gnu --host=i686-mingw32</code></p>



<p class="wp-block-paragraph">But with the Linux to PowerPC cross compiler in place, I was able to quickly generate a working toolchain.</p>



<p class="wp-block-paragraph">I copied in CILO, and added in a build batch file to manually build it, and updated the test directory to run it.</p>



<p class="wp-block-paragraph">So for those who are interested here is my toolchains:</p>



<ul class="wp-block-list">
<li><a href="http://vpsland.superglobalmegacorp.com/install/Linux-i386/linux-ppc.7z">Linux x86 to PowerPC ELF</a></li>



<li><a href="http://vpsland.superglobalmegacorp.com/install/mingw/MinGW-PowerPC-ELF.7z">MinGW to PowerPC ELF</a></li>
</ul>



<p class="wp-block-paragraph">And a mirror on <a href="https://sourceforge.net/projects/dynamips-mingw/files/?source=navbar">sourceforge</a> of my cross toolchains, <a href="https://sourceforge.net/projects/dynamips-mingw/files/PowerPC-ELF%20cross%20compilers/">PowerPC</a> and <a href="https://sourceforge.net/projects/dynamips-mingw/files/MIPS-ELF%20cross%20compilers/">MIPS</a>.</p>



<p class="wp-block-paragraph">As a minor addendum, The 1700 can run stuff that is far more complicated than the MIPS. &nbsp;I&#8217;m not sure why I get so many TLB violations for doing something more complicated but I (poorly) ported aclock to run on the cisco 1700!</p>


<div class="wp-block-image">
<figure class="aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2015/09/aclock-on-cisco-1700-PowerPC.png"><img decoding="async" src="https://virtuallyfun.com/wp-content/uploads/2015/09/aclock-on-cisco-1700-PowerPC.png" alt="Aclock on the cisco 1700 via Dynamips" class="wp-image-5549"/></a><figcaption class="wp-element-caption">Aclock on the cisco 1700 via Dynamips</figcaption></figure>
</div>


<p class="wp-block-paragraph">The Dynamips ROMMON emulator doesn&#8217;t provide the keyboard input function call so it can&#8217;t read from the keyboard. &nbsp;Also it can&#8217;t read the clock, so <a href="https://virtuallyfun.com/2010/11/14/simh-benchmark-numbers/">I have it running 250,000 dhrystones between clock ticks</a>. &nbsp;Although I think that is far too many, maybe 125,000 would be more like it but it runs on the PowerPC. &nbsp;While on the MIPS I get nothing but this:</p>



<p class="wp-block-paragraph">*** TLB (Load/Fetch) Exception ***<br>
PC = 0x80008964, Cause = 0x00008008, Status Reg = 0x00408103</p>



<p class="wp-block-paragraph">Oh well. &nbsp;Maybe it&#8217;s a stack problem I guess I&#8217;ll have to break down and do a memory map and write a malloc if I want to go down this road. &nbsp;Although back in 1999 this would be incredible but today I don&#8217;t think anyone would run anything but IOS on their cisco hardware.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2015/09/25/continuing-with-a-powerpc-elf-compiler-for-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Building a MIPS Compiler for Windows on a Linux VM!</title>
		<link>https://virtuallyfun.com/2015/09/24/building-a-mips-compiler-for-windows-on-a-linux-vm/</link>
					<comments>https://virtuallyfun.com/2015/09/24/building-a-mips-compiler-for-windows-on-a-linux-vm/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Thu, 24 Sep 2015 11:52:06 +0000</pubDate>
				<category><![CDATA[cisco]]></category>
		<category><![CDATA[cross compiler]]></category>
		<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[gcc]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=5538</guid>

					<description><![CDATA[I&#8217;ve tried to build a cross compiler on MinGW32 before, and despite there being obvious steps on how to do it, I&#8217;ve never gotten it to work.  Now I&#8217;ve built cross compilers before so it&#8217;s not like I don&#8217;t have &#8230; <a href="https://virtuallyfun.com/2015/09/24/building-a-mips-compiler-for-windows-on-a-linux-vm/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve tried to build a cross compiler on MinGW32 before, and despite <a href="http://wiki.osdev.org/GCC_Cross-Compiler">there being obvious steps on how to do it</a>, I&#8217;ve never gotten it to work.  Now I&#8217;ve built cross compilers before so it&#8217;s not like I don&#8217;t have any clue on what I&#8217;m doing, but the problem is that Windows isn&#8217;t UNIX, and I don&#8217;t want to use Cygwin.</p>
<p>So that enters another fun possibility known as the <a href="https://en.wikipedia.org/wiki/Cross_compiler#Canadian_Cross">Canadian Cross</a>, which is using a machine in the middle to build a compiler.  As we all know, Linux is great for building and running GNU software, so a Linux machine to build my cross compiler would be the best.  Now the whole point of this is that I wanted to build a MIPS program to run on <a href="https://sourceforge.net/p/dynamips-mingw/">Dynamips</a>.  And through a LOT of googling, I managed to find <a href="https://sourceforge.net/p/dynamips-mingw/code/ci/master/tree/cilo/">this program called CILO the cisco</a> Linux loader.  Now as far as I can tell the people trying to port Linux the the MIPS based cisco routers (3600 and 7200) never succeed, but they did manage to leave this bootloader behind.  And compiling it was very tricky as they gave no hints on what to use.  So with a lot of trial and error I found that binutils 2.18 is the minimal version that will work as the code depends on being able to do register aliasing which isn&#8217;t present in previous versions.  Also according <a href="http://www.linux-mips.org/wiki?title=Cisco&amp;oldid=10571">to this, they were using gcc 4.1.2 in their Linux port</a>. So with some luck I did mange to get CILO to build with a cross compiler on Linux.  Which was pretty awesome to see Dynamips run a C program!</p>
<p>But that doesn&#8217;t help me on the Windows side.</p>
<p>Now the first thing that I&#8217;d normally do is install the default MinGW cross tools, but because I need ancient binutils and GCC support as newer versions not only won&#8217;t work for what I want, but won&#8217;t build older versions I tried to keep things in step.  This meant on Linux I first had to build a Linux to Windows cross compiler using binutils version 2.25.1 and GCC version 4.1.2 . Configuring and building binutils was a snap with:</p>
<p style="padding-left: 30px;"><code>./configure --target=i686-mingw32 --prefix=/usr/local/mingw32</code></p>
<p>And configuring and building gcc was also a snap with:</p>
<p style="padding-left: 30px;"><code>./configure --target=i686-mingw32 --prefix=/usr/local/mingw32 --disable-libssp</code></p>
<p>I thought I could just use a new mingwrt and w32api but that proved disastrous as the newer libs gave me this fun error on trying to link a Win32 execuatable:</p>
<p style="padding-left: 30px;"><em>undefined reference to `___chkstk_ms&#8217;</em></p>
<p>And googling that around the consensus is that your binutils, and gcc is too old, and upgrade, granpa!  But I want old software so I naturally have to just use older versions, and for gcc 4.1.2 I wanted:</p>
<ul>
<li>mingwrt-3.18-mingw32-dev.tar.gz</li>
<li>w32api-3.15-1.mingw32-dev.tar.lzma</li>
</ul>
<p>Now I could build and link and test my Linux to Windows toolchain!</p>
<p>Now for the crazy part.</p>
<p>First I need a binutils, so I configured binutils 2.18 like this:</p>
<p style="padding-left: 30px;"><code>./configure --host=i686-mingw32 --target=mips-elf --prefix=/mips</code></p>
<p>And sure enough with a little prodding I had a MIPS assembler/linker/librarian and all that fun stuff!</p>
<p>Next was a little (ok a LOT) more fun which was building gcc.</p>
<p>After about 30 aborted attempts I finally got gcc to build with this:</p>
<p style="padding-left: 30px;"><code>./configure --target=mips-elf --prefix=/mips --disable-libssp --build=i486-linux-gnu --host=i686-mingw32</code></p>
<p>The fun part of course is that during the build, gcc will want to run the cross compiler and dump it&#8217;s host machine bit types by running &#8216;xgcc -dumpspecs&#8217;.  Well thankfully via wine, Linux can run Win32 execuatables so I saved myself a few minutes by not having to copy over the partial compiler, and run the command, and transfer the results back.</p>
<p>So with a bit more hand holding on the build I finally got it to finish compiling by linking /bin/true to fix-headers . What a mission.  Now I excitedly transfered my build to my Windows host, and setup some environment variables and built the hello world cisco application, and, it worked! (well crashes the same way as the pre-built one, but it does say:</p>
<p style="padding-left: 30px;">C7200 &#8216;default&#8217;: starting simulation (CPU0 PC=0xffffffffbfc00000), JIT disabled.<br />
ROMMON emulation microcode.</p>
<p style="padding-left: 30px;">Launching IOS image at 0x80008000&#8230;<br />
Hello World!<br />
Image returned to ROM.<br />
Reset in progress&#8230;</p>
<p>Which is pretty cool!</p>
<p>I tried to merge in a make utility but that turned out to be kind of screwed up, so I just copied the cross steps from Linux, and now I can build cilo on Windows!</p>
<p style="padding-left: 30px;">C7200 &#8216;default&#8217;: starting simulation (CPU0 PC=0xffffffffbfc00000), JIT disabled.<br />
ROMMON emulation microcode.</p>
<p style="padding-left: 30px;">Launching IOS image at 0x8000d2e4&#8230;<br />
CIL<br />
Error: Unable to find any valid flash! Aborting load.<br />
Image returned to ROM.<br />
Reset in progress&#8230;</p>
<p>It may not look like much, but It is running the program!  Dynamips is missing a bunch of hardware, like flash.  Or I found out the ability to read from the console using the promlib.  But it can print to it at least.</p>
<p>So for those who want to give it a try, here is my MIPS-ELF tool-chain for Win32, that includes the cisco loader!</p>
<ul>
<li><a href="http://vpsland.superglobalmegacorp.com/install/mingw/MinGW-MIPS-ELF_cilo.7z">MinGW to MIPS-ELF tool-chain</a>.</li>
<li><a href="http://vpsland.superglobalmegacorp.com/install/Linux-i386/linux-minw32.7z">Linux x86 to MinGW with GCC 4.1.2 tool-chain.</a></li>
<li><a href="http://vpsland.superglobalmegacorp.com/install/Linux-i386/linux-mips.7z">Linux x86 to MIPS ELF tool-chain</a>.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2015/09/24/building-a-mips-compiler-for-windows-on-a-linux-vm/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>One million packets served!</title>
		<link>https://virtuallyfun.com/2015/09/18/one-million-packets-served/</link>
					<comments>https://virtuallyfun.com/2015/09/18/one-million-packets-served/#comments</comments>
		
		<dc:creator><![CDATA[neozeed]]></dc:creator>
		<pubDate>Fri, 18 Sep 2015 01:27:37 +0000</pubDate>
				<category><![CDATA[Dynamips]]></category>
		<category><![CDATA[mingw]]></category>
		<category><![CDATA[SLiRP]]></category>
		<category><![CDATA[virtual networking]]></category>
		<guid isPermaLink="false">https://virtuallyfun.com/?p=5496</guid>

					<description><![CDATA[So over in my work on porting Dynamips to MinGW, I&#8217;ve created a version of SLiRP that sends and receives data over UDP. Â In retrospect, something I should have done a long time ago, as it makes troubleshooting it easier &#8230; <a href="https://virtuallyfun.com/2015/09/18/one-million-packets-served/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><div id="attachment_5497" style="width: 813px" class="wp-caption aligncenter"><a href="https://virtuallyfun.com/wp-content/uploads/2015/09/one-million-packets-served.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5497" class="size-full wp-image-5497" src="https://virtuallyfun.com/wp-content/uploads/2015/09/one-million-packets-served.png" alt="one million ICMP packets!" width="803" height="470" /></a><p id="caption-attachment-5497" class="wp-caption-text">Success rate is 100 percent (1000000/1000000)!</p></div></p>
<p>So over in my work on porting <a href="https://sourceforge.net/projects/dynamips-mingw/">Dynamips to MinGW</a>, I&#8217;ve created a version of SLiRP that sends and receives data over UDP. Â In retrospect, something I should have done a long time ago, as it makes troubleshooting it easier as now if it were to crash it&#8217;s a stand alone program, so it won&#8217;t crash the emulator.</p>
<p>The good news is that I&#8217;ve been able to copy files into the virtual router using HTTP. Â I&#8217;ve even been able to access my OS/2 machine over FTP and load a file!</p>
<p style="padding-left: 30px;">R1#copy ftp://10.12.0.14/README disk0:<br />
Destination filename [README]?<br />
Accessing ftp://10.12.0.14/README&#8230;<br />
Loading README !<br />
[OK &#8211; 76743/4096 bytes]</p>
<p style="padding-left: 30px;">76743 bytes copied in 8.740 secs (8781 bytes/sec)</p>
<p style="padding-left: 30px;">R1#dir disk0:README<br />
Directory of disk0:/README</p>
<p style="padding-left: 30px;">12 -rw- 76743 Sep 18 2015 09:01:08 +00:00 README</p>
<p style="padding-left: 30px;">66875392 bytes total (41652224 bytes free)</p>
<p>Which is very cool!</p>
<p>Part of the &#8216;trick&#8217; is that you should set your time out to be as long as possible to send a million packets. Â I just set the maximum values.</p>
<p style="padding-left: 30px;">line con 0</p>
<p style="padding-left: 60px;">exec-timeout 35791 23<br />
stopbits 1</p>
<p style="padding-left: 30px;">line aux 0</p>
<p style="padding-left: 60px;">stopbits 1</p>
<p style="padding-left: 30px;">line vty 0 4</p>
<p style="padding-left: 60px;">exec-timeout 35791 0<br />
timeout login response 300<br />
password cisco<br />
login</p>
<p style="padding-left: 30px;">!<br />
end</p>
<p>In addition, a 7200 with idle performs MUCH better than a 1700 without idle. Â There is something up with ptask, and only dispatching packets every so often. Â I&#8217;m guessing it&#8217;s done that way for a reason.</p>
<p>Also one other cool IOS trick I learned today is that you can redirect to a file resource! Say you want that &#8216;show tech-support&#8217; as a file on the disk? No problem!</p>
<p style="padding-left: 30px;">show tech-support | redirect disk0:tech.txt</p>
<p>And of course the newer versions of IOS have a &#8216;do&#8217; command that you can run from config mode to execute user commands.</p>
<p style="padding-left: 30px;">R1(config)#do who<br />
Line User Host(s) Idle Location<br />
* 0 con 0 idle 00:00:00<br />
2 vty 0 idle 15:24:11 10.0.2.2<br />
3 vty 1 idle 14:59:56 10.0.2.2<br />
4 vty 2 idle 13:43:44 10.0.2.2<br />
5 vty 3 idle 11:23:44 10.0.2.2</p>
<p>Â Take that Junos!</p>
<p>For anyone interested, <a href="https://sourceforge.net/projects/dynamips-mingw/files/latest/download?source=navbar">the binary is included in the latest binary snapshot</a>, and using it is pretty simple:</p>
<p style="padding-left: 30px;">slirp_rdr.exe 20001 127.0.0.1 20000</p>
<p>This will listen on port 20001, and send traffic to 127.0.0.1 on port 20000. Â Easy right?</p>
<p>Manually interfacing from the hypervisor can be the &#8216;fun&#8217; part. Â I haven&#8217;t tested with any of the tools, as I don&#8217;t know if they will let you leave something &#8216;listening&#8217; that isn&#8217;t connected. For my tests I end up building something with their UI, then loading up my hypervisor that logs, and seeing what it is actually doing so I can inject stuff like this:</p>
<p style="padding-left: 30px;">nio create_udp nio_udp99 20000 127.0.0.1 20001<br />
ethsw add_nio S1 nio_udp99<br />
ethsw set_access_port S1 nio_udp99 1</p>
<p>This creates a udp nio, and attaches it onto the virtual etherswitch S1, and puts it on VLAN 1. Â As you can see it listens on UDP port 20000, which is where slirp_rdr is setup to send it&#8217;s data to, and it&#8217;ll send to 20001 where slirp_rdr is listening.</p>
<p>I&#8217;ve hard coded port 42323 to telnet into 10.0.2.15. Â As always SLiRP is hard coded to have the following ip address schema:</p>
<p style="padding-left: 30px;">Gateway 10.0.2.2<br />
DNS 10.0.2.3<br />
Netmask 255.255.255.0</p>
<p>Be sure to set your router to 10.0.2.15/24 for this to work, and add 10.0.2.2 as your default gateway.</p>
<p>The ONLY address that will respond to ping is 10.0.2.2 . Â This is just the way SLiRP is. Â HTTP and TCP based stuff works best, things like PPTP will not. Â It&#8217;s really hit and miss, but the cool thing is that it doesn&#8217;t require any device drivers, it&#8217;s all user mode code!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://virtuallyfun.com/2015/09/18/one-million-packets-served/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
	</channel>
</rss>
