So over in my work on porting Dynamips to MinGW, I’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’s a stand alone program, so it won’t crash the emulator.
The good news is that I’ve been able to copy files into the virtual router using HTTP. Â I’ve even been able to access my OS/2 machine over FTP and load a file!
R1#copy ftp://10.12.0.14/README disk0:
Destination filename [README]?
Accessing ftp://10.12.0.14/README…
Loading README !
[OK – 76743/4096 bytes]
76743 bytes copied in 8.740 secs (8781 bytes/sec)
R1#dir disk0:README
Directory of disk0:/README
12 -rw- 76743 Sep 18 2015 09:01:08 +00:00 README
66875392 bytes total (41652224 bytes free)
Which is very cool!
Part of the ‘trick’ 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.
line con 0
exec-timeout 35791 23
stopbits 1
line aux 0
stopbits 1
line vty 0 4
exec-timeout 35791 0
timeout login response 300
password cisco
login
!
end
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’m guessing it’s done that way for a reason.
Also one other cool IOS trick I learned today is that you can redirect to a file resource! Say you want that ‘show tech-support’ as a file on the disk? No problem!
show tech-support | redirect disk0:tech.txt
And of course the newer versions of IOS have a ‘do’ command that you can run from config mode to execute user commands.
R1(config)#do who
Line User Host(s) Idle Location
* 0 con 0 idle 00:00:00
2 vty 0 idle 15:24:11 10.0.2.2
3 vty 1 idle 14:59:56 10.0.2.2
4 vty 2 idle 13:43:44 10.0.2.2
5 vty 3 idle 11:23:44 10.0.2.2
 Take that Junos!
For anyone interested, the binary is included in the latest binary snapshot, and using it is pretty simple:
slirp_rdr.exe 20001 127.0.0.1 20000
This will listen on port 20001, and send traffic to 127.0.0.1 on port 20000. Â Easy right?
Manually interfacing from the hypervisor can be the ‘fun’ part. Â I haven’t tested with any of the tools, as I don’t know if they will let you leave something ‘listening’ that isn’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:
nio create_udp nio_udp99 20000 127.0.0.1 20001
ethsw add_nio S1 nio_udp99
ethsw set_access_port S1 nio_udp99 1
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’s data to, and it’ll send to 20001 where slirp_rdr is listening.
I’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:
Gateway 10.0.2.2
DNS 10.0.2.3
Netmask 255.255.255.0
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.
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’s really hit and miss, but the cool thing is that it doesn’t require any device drivers, it’s all user mode code!
A strong suggestion next. Why not make a reference to how you did do the port to that compiler toolchain.
I can probably find the explanation in my collection of e-mail.but some people may not be so gifted.
I should also mention that this is good news, and OS/2 users should feel extremely gifted with something else….
I mentioned it here. It really was quite trivial, I’m more surprised that nobody else got it running.
And so you did.
Where did you get the image of IOS for it?
One fellow on that list for running a network of DEC built computers got it to work, and then got the images from an even more involved fellow on the same list.
However he runs FreeBSD and those DEC systems, and of course the Mac’s chosen OS.
Heh just google around for the magical string c7200 is mz and I’m sure you’ll find images in no time. From there re-google any image name and you’ll find more.
I’ll do one better, ages ago I not only setup a DecNET with IOS via Dynamips, I even ported over Synchronet to run on it! And of course Pathworks on NT to talk to VMS. It’s fun I can create not only virtual networks, but even virtual companies.
The next thing to do on Windows is to see why 64bit JIT is broken, something with word sizes being more 32bit friendly I think, and having to check Dynamips to make it more strongly 64bit typed. ..
Can you confirm default SLiRP in QEMU also doesn’t allow UDP forwarding? I am trying to debug my localhost PXE server running on host with QEMU and it seems impossible to pass packets from guest to host for this purpose.
https://serverfault.com/questions/928306/using-host-dhcp-server-with-qemu-user-mode-slirp-networking
What version of qemu? Platform and how are you running it?
Probably the best thing to do is packet capture the VM and see what it sees.
Otherwise you’d want to modify the source so slirp is writing a capture file of frames in and out. something I should do one day, if anything for myself. At least a usermode version of slirp let’s you build and debit it separately too