This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
использование_эмуляторов_оборудования_cisco_в_unix [2009/10/08 15:50] val |
использование_эмуляторов_оборудования_cisco_в_unix [2011/01/31 17:43] val |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Использование эмуляторов оборудования Cisco в UNIX ====== | ====== Использование эмуляторов оборудования Cisco в UNIX ====== | ||
+ | [[http://dynagen.org/tutorial.htm]] | ||
+ | |||
+ | ===== Установка и запуск эмулятора ===== | ||
+ | |||
+ | ==== FreeBSD ==== | ||
<code> | <code> | ||
- | [ms:~val] # pkg_add -r dynagen | + | [hostX:~] # pkg_add -r dynagen |
+ | |||
+ | [hostX:~] # rehash | ||
</code> | </code> | ||
- | ===== Превращение PC в Cisco router ===== | + | ==== Ubuntu ==== |
<code> | <code> | ||
- | [ms:~val] # cat gate.net | + | root@hostX:~# apt-get install dynagen |
+ | </code> | ||
+ | |||
+ | ==== FreeBSD/Ubuntu ==== | ||
+ | <code> | ||
+ | hostX# dynamips -H 7200 & | ||
+ | </code> | ||
+ | |||
+ | ===== Настройка параметров оборудования и запуск маршрутизатора в эмуляторе ===== | ||
+ | <code> | ||
+ | [hostX:~] # cat router.dng | ||
</code><code> | </code><code> | ||
[localhost] | [localhost] | ||
- | [[7200]] | + | [[ROUTER router.corpX.un]] |
- | image = c7200-is-mz.122-13.T10.bin | + | image = c7200-is-mz.123-21.bin |
ram = 160 | ram = 160 | ||
- | + | npe = npe-400 | |
- | [[ROUTER GATE]] | + | |
- | F0/0 = NIO_gen_eth:em0 | + | F1/0 = NIO_linux_eth:eth1 |
- | </code><code> | + | F1/1 = NIO_linux_eth:eth0 |
- | [ms:~val] # dynamips -H 7200 & | + | # F1/0 = NIO_gen_eth:em1 # For physical interface in FreeBSD |
+ | # F1/0 = NIO_linux_eth:vlan2 # For vlan interface in Linux | ||
+ | # F1/0 = NIO_gen_eth:vlan2 # For vlan interface in FreeBSD | ||
</code><code> | </code><code> | ||
- | [ms:~val] # dynagen gate.net | + | hostX# dynagen router.dng |
</code><code> | </code><code> | ||
=> list | => list | ||
Name Type State Server Console | Name Type State Server Console | ||
- | GATE 7200 running localhost:7200 2000 | + | router.corpX.un 7200 running localhost:7200 2000 |
</code><code> | </code><code> | ||
=> shell telnet localhost 2000 | => shell telnet localhost 2000 | ||
Line 32: | Line 51: | ||
Would you like to enter the initial configuration dialog? [yes/no]: no | Would you like to enter the initial configuration dialog? [yes/no]: no | ||
</code><code> | </code><code> | ||
+ | Router> enable | ||
+ | |||
Router# show run | Router# show run | ||
- | </code><code> | + | </code> |
- | hostname gate.corpX.un | + | |
- | interface FastEthernet0/0 | + | ===== Примеры dynagen конфигураций ===== |
- | no shut | + | |
- | ip address 192.168.X.1 255.255.255.0 | + | |
- | + | ||
- | interface FastEthernet0/0.2 | + | |
- | no shut | + | |
- | encapsulation dot1Q 2 | + | |
- | ip address 192.168.100+X.1 255.255.255.0 | + | |
- | + | ||
- | router ospf 100 | + | |
- | network 192.168.X.0 0.0.0.255 area 0 | + | |
- | redistribute connected subnets | + | |
- | </code> | + | |
- | ===== Примеры конфигураций ===== | + | ==== Цепочка роутеров ==== |
<code> | <code> | ||
- | [g13:/var/db/dynagen] # cat simple1.net | + | [hostX:~] # cat simple1.dng |
[localhost] | [localhost] | ||
- | [[7200]] | + | [[ROUTER R1]] |
- | image = /var/db/dynagen/c7200-is-mz.122-13.T10.bin | + | image = c7200-is-mz.123-21.bin |
npe = npe-400 | npe = npe-400 | ||
ram = 160 | ram = 160 | ||
| | ||
- | [[ROUTER R1]] | ||
s1/0 = R2 s1/0 | s1/0 = R2 s1/0 | ||
| | ||
[[router R2]] | [[router R2]] | ||
+ | </code> | ||
- | -------------------------------------- | ||
- | + | ==== Соединение роутеров, работающих на разных системах ==== | |
- | [g13:/var/db/dynagen] # cat qemulab.net | + | <code> |
- | [localhost] | + | [hostX:~] # cat distrlab.dng |
- | [[7200]] | + | [172.16.1.X] |
- | image = /var/db/dynagen/c7200-is-mz.122-13.T10.bin | + | [[ROUTER R1]] |
+ | image = c7200-is-mz.123-21.bin | ||
ram = 96 | ram = 96 | ||
- | [[ROUTER R13]] | ||
- | F0/0 = NIO_gen_eth:fxp0 | ||
- | F1/0 = NIO_gen_eth:tap0 | ||
- | |||
- | -------------------------------------- | ||
- | |||
- | |||
- | [g13:/var/db/dynagen] # cat distrlab.net | ||
- | [195.19.32.3] | ||
- | [[7200]] | ||
- | image = /var/db/dynagen/c7200-is-mz.122-13.T10.bin | ||
- | ram = 96 | ||
- | |||
- | [[ROUTER R1]] | ||
s1/0 = R2 s1/0 | s1/0 = R2 s1/0 | ||
F0/0 = NIO_gen_eth:fxp0 | F0/0 = NIO_gen_eth:fxp0 | ||
- | [195.19.32.6] | + | [172.16.1.Y] |
- | workingdir = /var/db/dynagen/ | + | workingdir = /root |
- | [[7200]] | + | [[ROUTER R2]] |
- | image = /var/db/dynagen/c7200-is-mz.122-13.T10.bin | + | image = c7200-is-mz.123-21.bin |
ram = 96 | ram = 96 | ||
- | [[ROUTER R2]] | ||
F0/0 = NIO_gen_eth:sis0 | F0/0 = NIO_gen_eth:sis0 | ||
- | |||
- | -------------------------------------- | ||
</code> | </code> | ||
- | |||
- |