Showing posts with label Cisco. Show all posts
Showing posts with label Cisco. Show all posts

Tuesday, 4 March 2014

Cisco ASA 8.4 on GNS3 in Linux

Best recommendation would be to test the qemu image before moving it into GNS3.

To find the location of the binaries:

user@pc:~ > which qemu-img
/usr/bin/qemu-img

then

user@pc:~/Cisco/ASA_842 > /usr/bin/qemu-system-i386 -name ASA1 -m 1024 -kernel ./asa842-vmlinuz -initrd ./asa842-initrd.gz -append "ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt" -netdev user,id=mynet0 -netdev user,id=mynet1 -netdev user,id=mynet2 -netdev user,id=mynet3 -netdev user,id=mynet4 -netdev user,id=mynet5 -device e1000,mac=00:00:ab:1a:f2:00,netdev=mynet0 -device e1000,mac=00:00:ab:df:12:01,netdev=mynet1 -device e1000,mac=00:00:ab:7e:73:02,netdev=mynet2 -device e1000,mac=00:00:ab:1c:9d:03,netdev=mynet3 -device e1000,mac=00:00:ab:db:25:04,netdev=mynet4 -device e1000,mac=00:00:ab:69:d8:05,netdev=mynet5 -serial telnet:127.0.0.1:4444,server,nowait -vnc none -vga none -icount auto -hdachs 980,16,32 -cpu coreduo -nographic

and then log into the ASA router virtual image with : telnet localhost 4444

if working as expected configure Qemu in GNS3:

and then the ASA:

Qemu options : -vnc none -vga none -icount auto -hdachs 980,16,32 -cpu coreduo -nographic
Kernel Cmd Line : ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt


If you want to run multiple ASA's configure the options accordingly e.g.
Qemu options : -vnc :2 none -vga none -icount auto -hdachs 980,16,32 -cpu coreduo -nographic

Thursday, 13 February 2014

Cisco config text highlighting with Gedit

The following files can be copied into the language folder to enable text highlighting for Cisco configurations

$ sudo cp ios.lang /usr/share/gtksourceview-3.0/language-specs/



ios.lang

<?xml version="1.0" encoding="UTF-8"?>
<language id="cisco-ios" _name="Cisco IOS" version="2.0" _section="Cisco">
  <metadata>
    <property name="mimetypes">text/plain</property>
    <property name="globs">*.cfg</property>
    <property name="comment-start">!</property>
  </metadata>
  <styles>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="identifier" _name="Interface" map-to="def:identifier"/>
    <style id="list" _name="Access List" map-to="def:preprocessor"/>
    <style id="number" _name="Number" map-to="def:preprocessor"/>
  </styles>
  <definitions>
    <context id="comment" style-ref="comment" end-at-line-end="true">
      <start>!</start>
    </context>
    <context id="description" style-ref="comment" end-at-line-end="true">
      <start>description</start>
    </context>

    <context id="hostname" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>hostname</start>
    </context>
    <context id="interface" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>interface</start>
    </context>
    <context id="policy-map" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>policy-map</start>
    </context>
    <context id="class-map" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>class-map</start>
    </context>
    <context id="controller" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>controller</start>
    </context>
    <context id="linevty" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>line vty</start>
    </context>
    <context id="linecon" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>line con</start>
    </context>
    <context id="lineaux" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>line aux</start>
    </context>

    <context id="lists" style-ref="list">
      <keyword>access-list</keyword>
      <keyword>ip route</keyword>
      <keyword>ip nat</keyword>
    </context>

    <context id="routers" style-ref="identifier">
      <keyword>router rip</keyword>
      <keyword>router eigrp</keyword>
      <keyword>router igrp</keyword>
      <keyword>router ospf</keyword>
      <keyword>router bgp</keyword>
    </context>

    <context id="number" style-ref="number">
      <match>(\b[0-9]+(\.[0-9]+)?|\.[0-9]+)([Ee][\+-]?[0-9]+)?\b</match>
    </context>
    <context id="cisco-ios">
      <include>
        <context ref="comment"/>
        <context ref="description"/>
        <context ref="hostname"/>
        <context ref="interface"/>
        <context ref="controller"/>
        <context ref="linevty"/>
        <context ref="linecon"/>
        <context ref="lineaux"/>
        <context ref="policy-map"/>
        <context ref="class-map"/>
        <context ref="lists"/>
        <context ref="routers"/>
        <context ref="number"/>
       </include>
    </context>
  </definitions>
</language>


asa.lang

<?xml version="1.0" encoding="UTF-8"?>
<language id="cisco-firewall" _name="Cisco PIX/ASA" version="2.0"
_section="Cisco">
  <metadata>
    <property name="mimetypes">text/plain</property>
    <property name="globs">*.txt;</property>
    <property name="comment-start">!</property>
  </metadata>
  <styles>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="identifier" _name="Interface" map-to="def:keyword"/>
    <style id="access-list" _name="Access List" map-to="def:preprocessor"/>
    <style id="static" _name="Static" map-to="def:string"/>
    <style id="nat" _name="NAT" map-to="def:type"/>
    <style id="route" _name="Route" map-to="def:preprocessor"/>
    <style id="number" _name="Number" map-to="def:comment"/>
  </styles>
  <definitions>
    <context id="comment" style-ref="comment" end-at-line-end="true">
      <start>!</start>
    </context>
    <context id="description" style-ref="comment" end-at-line-end="true">
      <start>description</start>
    </context>

    <context id="hostname" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>hostname</start>
    </context>
    <context id="ip-address" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>ip address</start>
    </context>
    <context id="interface" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>interface</start>
    </context>
    <context id="policy-map" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>policy-map</start>
    </context>
    <context id="class-map" end-at-line-end="true" extend-parent="false"
style-ref="identifier">
      <start>class-map</start>
    </context>

    <context id="access-list" end-at-line-end="true" extend-parent="false"
style-ref="access-list">
      <start>access-list</start>
    </context>

    <context id="access-group" end-at-line-end="true" extend-parent="false"
style-ref="access-list">
      <start>access-group</start>
    </context>

    <context id="static" end-at-line-end="true" extend-parent="false"
style-ref="static">
      <start>static</start>
    </context>

    <context id="nat" end-at-line-end="true" extend-parent="false"
style-ref="nat">
      <start>nat</start>
    </context>

    <context id="route" end-at-line-end="true" extend-parent="false"
style-ref="route">
      <start>route</start>
    </context>

    <context id="number" style-ref="number">
      <match>(\b[0-9]+(\.[0-9]+)?|\.[0-9]+)([Ee][\+-]?[0-9]+)?\b</match>
    </context>
    <context id="cisco-firewall">
      <include>
        <context ref="comment"/>
        <context ref="description"/>
        <context ref="ip-address"/>
        <context ref="hostname"/>
        <context ref="interface"/>
        <context ref="policy-map"/>
        <context ref="class-map"/>
        <context ref="access-list"/>
        <context ref="access-group"/>
        <context ref="static"/>
        <context ref="nat"/>
        <context ref="route"/>
        <context ref="number"/>
       </include>
    </context>
  </definitions>
</language>