PEMU - Pix EMUlation and Dynamips - windows
We have ever seen in a previous article how dynamips can BE AWESOME. Dynamips helps us to emulate the hardware part of a router, but what about PIX ??!
So we can use PEMU !!
You will be able to find in this article the way to use PEMU, and more important, the way to couple PEMU with dynamips in order to emulate an entire network.
This article will deal with PEMU under windows, we will see in another article how to do the same thing for linux users.
To start we have to download PEMU (you have to create an account [free] in order to get the file).
Once we have it we untar the file and we get a folder which includes these files:
Place your PIX ios image in this folder, here I will use a pix722 image.
Edit the pemu.ini file and adapt it to the name of your image. You also can put the activation key of your PIX. If you don’t put this key, you will only have access to the default settings of your image.
serial=0x30392303 image=pix722 key=0x00000000,0x00000000,0x00000000,0x00000000 bios1=mybios_d8000 bios2=bios.bin bios_checksum=1
Now open a console and navigate to the pemu folder
X:\\Documents and Settings\\bdg>cd Desktop/newversion_pemu
In this example we want to create an emulation with 2 interfaces connected to 2 routers we will launch with dynamips.
In the PEMU folder create an empty file named FLASH otherwise pemu will try to write in this file, and an error will occur because this file does not exist.
Then we will be able to launch pemu:
X:\\Documents and Settings\\bdg\\Desktop\\newversion_pemu>pemu.exe -net nic, macaddr=AA:AA:AA:00:00:01 -net udp,sport=1000,dport=1001,daddr=127.0.0.1 -net nic,macaddr=AA:AA:AA:00:00:02 -net udp,sport=2000,dport=2001, daddr=127.0.0.1 -serial telnet::666,server FLASH
Here we have launched our pix image with 2 interfaces on the UDP ports 1000,1001 and 2000,2001 (1000 for the source port and 1001 the destination port, same thing for 2000 and 2001).
To connect to the PIX, open another console an telnet localhost on the 666 TCP port.
X:\\>telnet 127.0.0.1 666
and you get something like that:
You can now configure your pix ![]()
A little problem occurs, when you type a command, an extra line is generated. This little bug can be fixed by configuring the telnet application you are using.
For the AZERTY users, type ctrl+$
For the QWERTY users, type ctrl+]
Welcome to Microsoft Telnet Client Escape Character is 'CTRL+$' Microsoft Telnet> unset crlf Line feed mode - Causes return key to send CR Microsoft Telnet>[enter]
Type enter to go back to the pix.
Now all is good.
We are now going to see how to couple this PIX with the routers we will emulate with dynamips.
This will be very simple, we will bind an interface of a router to the interface:
NIO_udp:1001:127.0.0.1:1000
NIO_udp:2001:127.0.0.1:2000
That’s all folks !
Here is an example of a dynamips configuration file.
ghostios = true
sparsemem = true[localhost]
[[2620]]
image = \\Program Files\\Dynamips\\imagesc2600-adventerprisek9-mz.123-14.T7.bin
idlepc = 0x802420dc
ram = 128
[[ROUTER R1]]
model = 2620
f0/0 = NIO_udp:1001:127.0.0.1:1000
[[ROUTER R2]]
model = 2620
f0/0 = NIO_udp:2001:127.0.0.1:2000
When you configure your pix, ethernet 0 will be for the first udp port specified on the pix launched, so here it’s 1001, 1000, ethernet 1 the second one, etc..
TIPS:
If you unzip the PIX image you will save more speed when you will launch pemu, but don’t forget to change the name in the pemu.ini file.
You can create a .bat file in your pemu folder in order to lauch pemu quicker, the file will look like this:
pemu.exe -net nic,macaddr=AA:AA:AA:00:00:01 -net udp,sport=1000,dport=1001, daddr=127.0.0.1 -netnic,macaddr=AA:AA:AA:00:00:02 -net udp,sport=2000,dport=2001, daddr=127.0.0.1 -serial telnet::666,server FLASH
4 Comments to PEMU - Pix EMUlation and Dynamips - windows
Hi Alex,
Do you now that you have to register to a shitty forum in order to download pEmu?
Don’t forget to mention it in your message.
It’ll be easier to store pEmu in the website and provide a direct link.
Hi got4close,
Yes I know that, that’s true I didn’t mention it. I’ll edit the post.
But we won’t store pemu in our website for the simple reason that it’s not our release. So we just put a link to the forum http://7200emu.hacki.at/
cya ![]()
hi
this is sandesh.
please tell me where i get PEMU.exe for pix firewall? i know how to configure dynmips for router & switches.
But i dont get PEMU any where plz tell me where i get that & how to hanksconfigure it?
T
Hi Sandesh,
If you follow this link:
http://www.pemu.net.cn/?p=51 (at the beginning of the article).
You are redirected to this page:
http://www.pemu.net.cn/pemu_public_win_2007-07-15-net-pcap-available/
And on this webpage you have a link to download pemu on the hacki.at forum:
http://7200emu.hacki.at/download.php?id=573
But you have to create a free account to access the release.
December 2, 2007