论坛升级后通告

论坛注册须知

NetEmu社区 FAQ

NetEmu招募新版主

企业IT架构选型选购与应用

中小企业轻松建网实操攻略

论坛强烈声明

广告招租QQ:1164258114

返回列表 回复 发帖

[原创] Qemu模拟ASA802(讨论帖非应用)

最近在网上看到一篇关于 如何解压 Cisco firewall OS 大家有兴趣可以点进去看看.7200emu上也有讨论
asa802-k8 是基于linux内核
http://www.cisco.com/en/US/products/ps6120/prod_release_note09186a008086944e.html

一.如何从asa802-k8.bin解压出核心,我直接删除掉了,免得大家晕头,兴趣的去看上面的链接Cisco firewall OS
      
   
二.运行asa802,

创建虚拟硬盘文件可以dd,也可以qemu-img
linux:
  1. qemu -hda FLASH -m 256 -kernel vmlinuz -initrd asa802-k8.gz -kernel-kqemu
  2. -nographic -append "auto console=ttyS0,9600 bigphysarea=16384
  3. ide1=noprobe"
复制代码
windows:
  1. qemu -L . -hda FLASH -m 256 -kernel vmlinuz
  2. -initrd asa802-k8.gz -append "auto ide1=noprobe console=ttyS0,9600
  3. bigphysarea=16384" -serial telnet::1234,server,nowait
复制代码
如果你CPU 100%,用BES

windows截图:





初始化信息:
  1. Linux version 2.6.17.8 (kevfox@kevfox-lnx) (gcc version 4.0.2) #5 PREEMPT Mon Ma
  2. y 7 18:35:37 EDT 2007
  3. BIOS-provided physical RAM map:
  4. BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
  5. BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
  6. BIOS-e820: 00000000000e8000 - 0000000000100000 (reserved)
  7. BIOS-e820: 0000000000100000 - 000000000fff0000 (usable)
  8. BIOS-e820: 000000000fff0000 - 0000000010000000 (ACPI data)
  9. BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
  10. 0MB HIGHMEM available.
  11. 255MB LOWMEM available.
  12. DMI not present or invalid.
  13. Allocating PCI resources starting at 20000000 (gap: 10000000:effc0000)
  14. Built 1 zonelists
  15. Kernel command line: auto console=ttyS0,9600 bigphysarea=16384 ide1=noprobe
  16. ide_setup: ide1=noprobe
  17. Enabling fast FPU save and restore... done.
  18. Enabling unmasked SIMD FPU exception support... done.
  19. Initializing CPU#0
  20. PID hash table entries: 1024 (order: 10, 4096 bytes)
  21. Detected 1667.045 MHz processor.
  22. Using tsc for high-res timesource
  23. Console: colour dummy device 80x25
  24. Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
  25. Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
  26. Memory: 178644k/262080k available (1553k kernel code, 82932k reserved, 348k data
  27. , 116k init, 0k highmem)
  28. Checking if this processor honours the WP bit even in supervisor mode... Ok.
  29. Calibrating delay using timer specific routine.. 3458.09 BogoMIPS (lpj=6916185)
  30. Mount-cache hash table entries: 512
  31. monitor/mwait feature present.
  32. using mwait in idle threads.
  33. CPU: L1 I cache: 32K, L1 D cache: 32K
  34. CPU: L2 cache: 2048K
  35. Intel machine check architecture supported.
  36. Intel machine check reporting enabled on CPU#0.
  37. CPU: Intel(R) Core(TM)2 CPU         T5500  @ 1.66GHz stepping 06
  38. Checking 'hlt' instruction... OK.
  39. SMP alternatives: switching to UP code
  40. Freeing SMP alternatives: 0k freed
  41. Unpacking initramfs... done
  42. Freeing initrd memory: 12917k freed
  43. NET: Registered protocol family 16
  44. PCI: PCI BIOS revision 2.10 entry at 0xfa110, last bus=0
  45. Setting up standard PCI resources
  46. PCI: Probing PCI hardware
  47. PCI quirk: region b000-b03f claimed by PIIX4 ACPI
  48. PCI quirk: region b100-b10f claimed by PIIX4 SMB
  49. PCI: Using IRQ router PIIX/ICH [8086/7000] at 0000:00:01.0
  50. PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
  51. NET: Registered protocol family 2
  52. IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
  53. TCP established hash table entries: 8192 (order: 3, 32768 bytes)
  54. TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
  55. TCP: Hash tables configured (established 8192 bind 4096)
  56. TCP reno registered
  57. Machine check exception polling timer started.
  58. Total HugeTLB memory allocated, 0
  59. bigphysarea: Allocated 16384 pages at 0xdf49f000.
  60. Initializing Cryptographic API
  61. io scheduler noop registered
  62. io scheduler anticipatory registered (default)
  63. io scheduler deadline registered
  64. io scheduler cfq registered
  65. Limiting direct PCI/PCI transfers.
  66. PCI: PIIX3: Enabling Passive Release on 0000:00:01.0
  67. Activating ISA DMA hang workarounds.
  68. Serial: 8250/16550 driver $Revision: #2 $ 4 ports, IRQ sharing disabled
  69. serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
  70. loop: loaded (max 8 devices)
  71. pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
  72. tun: Universal TUN/TAP device driver, 1.6
  73. tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
  74. Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
  75. ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
  76. hda: QEMU HARDDISK, ATA DISK drive
  77. ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
  78. hda: max request size: 512KiB
  79. hda: 262144 sectors (134 MB) w/256KiB Cache, CHS=260/255/63
  80. hda: set_multmode: status=0 { DriveReady Error }
  81. hda: set_multmode: error=0x04 { DriveStatusError }
  82. ide: failed opcode was: 0xef
  83. hda: cache flushes supported
  84. hda: hda1
  85. TCP bic registered
  86. NET: Registered protocol family 1
  87. NET: Registered protocol family 17
  88. Using IPI Shortcut mode
  89. Freeing unused kernel memory: 116k freed
  90. FAT: "posix" option is obsolete, not supported now
  91. TIPC: Activated (compiled May  2 2007 15:38:08)
  92. NET: Registered protocol family 30
  93. TIPC: Started in single node mode
  94. TIPC: Started in network mode
  95. TIPC: Own node address <1.1.1>, network identity 1234
  96. TIPC: Enabled bearer <eth:tap0>, discovery domain <1.1.0>, priority 10

  97. Processor memory 164855808, Reserved memory: 20971520 (DSOs: 0 + kernel: 2097152
  98. 0)
  99. Guest RAM start: 0xd4c00080
  100. Guest RAM   end: 0xdd400000
  101. LINA unit number: 1
  102. Guest RAM   brk: 0xd4c01000

  103. MKDIR failed No such file or directory for /var/log/
  104. Welcome to LINA - ( F1-on-Linux platform ) desktop version!

  105.     ********************************************************************
  106.     *  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
  107.     *                                                                  *
  108.     *  This product is for Cisco internal use ONLY!!!                  *
  109.     *                                                                  *
  110.     *  WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
  111.     ********************************************************************

  112. i2c_read_byte_w_wait() error, slot = 0x4, device = 0xb0, address = 0 byte count
  113. = 1. Reason: I2C_SMBUS_UNSUPPORT

  114. Total SSMs found: 0
  115. Ignoring PCI card in slot:0 (vendor:0x0 deviceid:0x0)
  116. Ignoring PCI card in slot:1 (vendor:0x0 deviceid:0x0)
  117. Ignoring PCI card in slot:2 (vendor:0x0 deviceid:0x0)
  118. Ignoring PCI card in slot:3 (vendor:0x0 deviceid:0x0)
  119. Ignoring PCI card in slot:4 (vendor:0x0 deviceid:0x0)
  120. Ignoring PCI card in slot:5 (vendor:0x0 deviceid:0x0)
  121. Ignoring PCI card in slot:6 (vendor:0x0 deviceid:0x0)

  122. Total NICs found: 6
  123. Error in ioctl SIOGIFINDEX
  124. Failed to open linaeth for interface 0 - verify the support in kernel

  125. Error in ioctl SIOGIFINDEX
  126. Failed to open linaeth for interface 1 - verify the support in kernel

  127. Error in ioctl SIOGIFINDEX
  128. Failed to open linaeth for interface 2 - verify the support in kernel

  129. Error in ioctl SIOGIFINDEX
  130. Failed to open linaeth for interface 3 - verify the support in kernel

  131. Error in ioctl SIOGIFINDEX
  132. Failed to open linaeth for interface 4 - verify the support in kernel

  133. Error in ioctl SIOGIFINDEX
  134. Failed to open linaeth for interface 5 - verify the support in kernel


  135. INFO: Unable to read firewall mode from flash
  136.        Writing default firewall mode (single) to flash
  137. WARNING: Unable to write firewall mode to flash, this is normal if flash is
  138.          not formatted.
  139.   --------------------------------------------------------------------------
  140.                                  .            .
  141.                                  |            |
  142.                                 |||          |||
  143.                               .|| ||.      .|| ||.
  144.                            .:||| | |||:..:||| | |||:.
  145.                             C i s c o  S y s t e m s
  146.   --------------------------------------------------------------------------

  147. Cisco Adaptive Security Appliance Software Version 8.0(2)
  148. Cannot open interface card (media_ethernet/port/id/0)
  149. pix_idb_create: Unable to get link capabilities 0
  150. pix_idb_create: Unable to get nic_stats for port 0
  151. Cannot open interface card (media_ethernet/port/id/1)
  152. pix_idb_create: Unable to get link capabilities 1
  153. pix_idb_create: Unable to get nic_stats for port 1
  154. Cannot open interface card (media_ethernet/port/id/2)
  155. pix_idb_create: Unable to get link capabilities 2
  156. pix_idb_create: Unable to get nic_stats for port 2
  157. Cannot open interface card (media_ethernet/port/id/3)
  158. pix_idb_create: Unable to get link capabilities 3
  159. pix_idb_create: Unable to get nic_stats for port 3
  160. Cannot open interface card (media_ethernet/port/id/4)
  161. pix_idb_create: Unable to get link capabilities 4
  162. pix_idb_create: Unable to get nic_stats for port 4
  163. Cannot open interface card (media_ethernet/port/id/5)
  164. pix_idb_create: Unable to get link capabilities 5
  165. pix_idb_create: Unable to get nic_stats for port 5

  166.   ****************************** Warning *******************************
  167.   This product contains cryptographic features and is
  168.   subject to United States and local country laws
  169.   governing, import, export, transfer, and use.
  170.   Delivery of Cisco cryptographic products does not
  171.   imply third-party authority to import, export,
  172.   distribute, or use encryption. Importers, exporters,
  173.   distributors and users are responsible for compliance
  174.   with U.S. and local country laws. By using this
  175.   product you agree to comply with applicable laws and
  176.   regulations. If you are unable to comply with U.S.
  177.   and local laws, return the enclosed items immediately.

  178.   A summary of U.S. laws governing Cisco cryptographic
  179.   products may be found at:
  180.   http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

  181.   If you require further assistance please contact us by
  182.   sending email to export@cisco.com.
  183.   ******************************* Warning *******************************

  184. Copyright (c) 1996-2007 by Cisco Systems, Inc.

  185.                 Restricted Rights Legend

  186. Use, duplication, or disclosure by the Government is
  187. subject to restrictions as set forth in subparagraph
  188. (c) of the Commercial Computer Software - Restricted
  189. Rights clause at FAR sec. 52.227-19 and subparagraph
  190. (c) (1) (ii) of the Rights in Technical Data and Computer
  191. Software clause at DFARS sec. 252.227-7013.

  192.                 Cisco Systems, Inc.
  193.                 170 West Tasman Drive
  194.                 San Jose, California 95134-1706

  195. open or write(ffsdev/2/write/32) failed
  196. Could not initialize system files in flash.
  197. i2c_read_byte_w_suspend() error, slot = 0x4, device = 0xb0, address = 0 byte cou
  198. nt = 1. Reason: I2C_SMBUS_UNSUPPORT
  199. i2c_read_byte_w_suspend() error, slot = 0x4, device = 0xb0, address = 0 byte cou
  200. nt = 1. Reason: I2C_SMBUS_UNSUPPORT
  201. Type help or '?' for a list of available commands.
  202. ciscoasa>
复制代码
附件: 您所在的用户组无法下载或查看附件
没活说,赞!!!!
If you want to contact with me.
Please Enter My Web Site.
Http://Www.Ice-Man.Cn          Http://Www.CiscoVista.Cn

太好了!大家共同学习!
又是一个网络界的创举,只有一个字“服”。
顶,牛人太多了
我看了半天,晕了!
强烈期待中!!!ACS应该是vpn3000的替代品啊!
重新改了一下帖子
cisco asa emulation
cisco asa simulation
www.netemu.cn
致力于网络模拟器的应用
ps:模拟器问题请在论坛直接提问
怎么加网卡并和本地网络连接?

[ 本帖最后由 ronsun 于 2007-11-4 12:36 编辑 ]
楼上的问题很关键啊?
原帖由 ronsun 于 2007-11-4 11:57 发表
怎么加网卡并和本地网络连接?
如果只是单个只能练习命令
和其它模拟器通讯才是重要的!
不过能模拟出来了 就会有下一步了
还没有找到办法加TAP通信.
If you want to contact with me.
Please Enter My Web Site.
Http://Www.Ice-Man.Cn          Http://Www.CiscoVista.Cn

等待能和本地通信的版本
配置不能保存: (Internal ATA Compact Flash, 0MB ?)
ciscoasa# write
Building configuration...
Cryptochecksum: 6e33e06b 255d8b92 90c27d70 9f5b4de4

%Error copying system:/running-config (Not enough space on device)
Error executing command
[FAILED]

ciscoasa> show version

Cisco Adaptive Security Appliance Software Version 8.0(2)

Compiled on Fri 15-Jun-07 19:29 by builders
System image file is "Unknown, monitor mode tftp booted image"
Config file at boot was "startup-config"

ciscoasa up 38 secs

Hardware:   , 128 MB RAM, CPU Pentium II 2993 MHz
Internal ATA Compact Flash, 0MB
BIOS Flash Firmware Hub @ 0xffe00000, 1024KB

0: Ext: Ethernet0/0         : irq 255
1: Ext: Ethernet0/1         : irq 255
2: Ext: Ethernet0/2         : irq 255
3: Ext: Ethernet0/3         : irq 255
4: Ext: Ethernet0/4         : irq 255
5: Ext: Ethernet0/5         : irq 255
VLANs                        : 200
Failover                     : Active/Active
3DES-AES                     : Enabled
Security Contexts            : 20
GTP/GPRS                     : Enabled
VPN Peers                    : 5000
WebVPN Peers                 : 2500
ADV END SEC                  : Enabled

Serial Number: 123456789AB
Running Activation Key: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Configuration register is 0x0
Configuration has not been modified since last system restart.
ciscoasa#
ciscoasa# wr
Building configuration...
Cryptochecksum: 6e33e06b 255d8b92 90c27d70 9f5b4de4

%Error copying system:/running-config (Not enough space on device)
Error executing command
[FAILED]
ciscoasa#
ciscoasa#


ciscoasa# show ver

Cisco Adaptive Security Appliance Software Version 8.0(2)

Compiled on Fri 15-Jun-07 19:29 by builders
System image file is "Unknown, monitor mode tftp booted image"
Config file at boot was "startup-config"

ciscoasa up 1 min 57 secs

Hardware:   , 128 MB RAM, CPU Pentium II 2395 MHz
Internal ATA Compact Flash, 256MB
BIOS Flash Firmware Hub @ 0xffe00000, 1024KB

0: Ext: Ethernet0/0         : irq 255
1: Ext: Ethernet0/1         : irq 255
2: Ext: Ethernet0/2         : irq 255
3: Ext: Ethernet0/3         : irq 255
4: Ext: Ethernet0/4         : irq 255
5: Ext: Ethernet0/5         : irq 255
VLANs                        : 200
Failover                     : Active/Active
3DES-AES                     : Enabled
Security Contexts            : 20
GTP/GPRS                     : Enabled
VPN Peers                    : 5000
WebVPN Peers                 : 2500
ADV END SEC                  : Enabled

Serial Number: 123456789AB
Running Activation Key: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Configuration register is 0x0
Configuration has not been modified since last system restart.
ciscoasa#
Netemu@gmail.com
QQ:247656
Netemu提问技巧
http://netemu.cn/bbs/thread-8031-1-1.html
四:其他
不能保存配置
启动时候有警告

INFO: Unable to read firewall mode from flash
       Writing default firewall mode (single) to flash
WARNING: Unable to write firewall mode to flash, this is normal if flash is
         not formatted.
Netemu@gmail.com
QQ:247656
Netemu提问技巧
http://netemu.cn/bbs/thread-8031-1-1.html
大家都在期待中...
原帖由 小漏 于 2007-11-4 23:11 发表
四:其他
不能保存配置
启动时候有警告

INFO: Unable to read firewall mode from flash
       Writing default firewall mode (single) to flash
WARNING: Unable to write firewall mode to flash, this i ...
格式话不了
www.netemu.cn
致力于网络模拟器的应用
ps:模拟器问题请在论坛直接提问
原帖由 oklxw 于 2007-11-4 01:25 发表
强烈期待中!!!ACS应该是vpn3000的替代品啊!
是真的吗?我还在找VPN的模拟器呢,VPN是我在所有思科的东西中除了路由以外最感兴趣的东西了,现在...
谢谢分享,支持哈!!
asa802-k8.gz这个怎么下载不下来?
FAT: "posix" option is obsolete, not supported now
这个提示是不是内核不支持这样的路径呀
I think we are close to getting asa to work on qemu. Like others, I could boot up to asa and play with the config. However, I see 2 major problems:

1. Could not mount the flash device. So one cannot save the config.

2. Could not get connectivity to host or external network.

Regarding #1, notice the error messages during bootup:

Code:
mount: Mounting /dev/hda1 on /mnt/disk0 failed: No such device or address
mount: Mounting /dev/hda1 on /mnt/disk0 failed: No such device or address


If you look in /etc/init.d/rcS.common, you can see:

Code:
mount -t vfat -o $MOUNT_OPTS /dev/hda1 /mnt/disk0 2>/fserr ||
mount /dev/hda1 /mnt/disk0 2>>/fserr ||
cat /fserr >&2


It is mounting the flash as vfat or default linux filesystems. (In real asa it is ATA compactflash.)

I played with different filesystems: it seems to be missing some vfat device files so it would always say "No such device"; I tried ext3 filesystem and it mounted ok but still lina could not see it.

Code:
ciscoasa# sh file sys

File Systems:

     Size(b)     Free(b)      Type  Flags  Prefixes
* 0           0           disk      rw      disk0: flash:
           -           -  network   rw      tftp:
           -           -  opaque    rw      system:
           -           -  network   ro      http:
           -           -  network   ro      https:
           -           -  network   rw      ftp:
           -           -  network   rw      smb:

ciscoasa# sh flash:
--#--  --length--  -----date/time------  path
  413  0           Oct 29 2007 02:51:37  .private
  423  0           Oct 29 2007 02:51:37  .private/DATAFILE
  422  0           Oct 29 2007 02:51:35  .private/mode.dat

0 bytes total (0 bytes free)
ciscoasa#


Regarding #2, I tried eepro100 and pcnet. It did not work with eepro100, and pcnet worked only in linux mode (I could ping from host pc to qemu) but not in lina mode. Lina did not show any errors but just did not get any packets in or out. It defaults to installing 6 nics:


Code:
ciscoasa# sh ver

Cisco Adaptive Security Appliance Software Version 8.0(2)

Compiled on Fri 15-Jun-07 19:29 by builders
System image file is "Unknown, monitor mode tftp booted image"
Config file at boot was "startup-config"

ciscoasa up 35 secs

Hardware:   , 512 MB RAM, CPU Pentium II 2000 MHz
Internal ATA Compact Flash, 1024MB
BIOS Flash Firmware Hub @ 0xffe00000, 1024KB

0: Ext: Ethernet0/0         : address is 00aa.0002.2200, irq 255
1: Ext: Ethernet0/1         : address is 00aa.0002.2201, irq 255
2: Ext: Ethernet0/2         : address is 00aa.0002.2202, irq 255
3: Ext: Ethernet0/3         : address is 00aa.0002.2203, irq 255
4: Ext: Ethernet0/4         : address is 00aa.0002.2204, irq 255
5: Ext: Ethernet0/5         : address is 00aa.0002.2205, irq 255
VLANs                        : 200
Failover                     : Active/Active
3DES-AES                     : Enabled
Security Contexts            : 20
GTP/GPRS                     : Enabled
VPN Peers                    : 5000
WebVPN Peers                 : 2500
ADV END SEC                  : Enabled

Serial Number: 123456789AB
Running Activation Key: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
Configuration register is 0x0
Configuration has not been modified since last system restart.
ciscoasa#


I guess we need to play with it some more, and hope someone could solve these problems
Netemu@gmail.com
QQ:247656
Netemu提问技巧
http://netemu.cn/bbs/thread-8031-1-1.html
赞一个,马上试试
拜一个~~~~~~~~~~~
我再顶!这个的确是好东西!
请问怎么安装AIP模块?谢谢
期待进一步发展,呵呵!
真是太牛了,哈哈!
返回列表