labunix's blog

labunixのラボUnix

GNS3でL2のPortChannelを作成してみる。

■GNS3でL2のPortChannelを作成してみる。
 要件はとりあえず、pingが通れば良しとする。

$ gns3 --version
gns3 0.8.7

■NW概略図は以下。

$ echo "[C3] <-- fe-1/0 --> [R1] <-- Po1(fe-1/14,15) --> [R2] <-- fe1/0 --> [C4]" | \
    graph-easy --dot | dot -T png -o L2-PortChannel.png

■イメージには、[c3725-adventerprisek9-mz.124-15.T14.bin]を、
 C[34]には、スロットにNICを追加した。

$ awk '/\[\[|slot|image/' GNS3/Projects/L2-PortChannel/topology.net 
    [[3620]]
        image = /home/labunix/GNS3/Images/ios/c3620-is-mz.123-1.image
    [[ROUTER C3]]
        slot0 = NM-1FE-TX
        slot1 = NM-1FE-TX
    [[ROUTER R1]]
        slot0 = NM-1FE-TX
        slot1 = NM-16ESW
    [[ROUTER R2]]
        slot0 = NM-1FE-TX
        slot1 = NM-16ESW
    [[ROUTER C4]]
        slot0 = NM-1FE-TX
        slot1 = NM-1FE-TX


■コンフィグは以下。

$ for n in 1 2;do \
  echo "
vlan database
vlan 10
exit
configure terminal
 !
 hostname R${n}
 !
 interface FastEthernet1/0
  shutdown
  switchport mode access
  switchport access vlan 10
  no shutdown
 !
 interface Vlan10
  shutdown
  ip address 192.168.0.${n} 255.255.255.0
  no shutdown
 !
 interface range FastEthernet1/14 -15
  shutdown
  switchport trunk allowed vlan 1,2,10,200,1002-1005
  switchport mode trunk
  channel-group 1 mode on
  no shutdown
 !
 interface Port-channel1
  shutdown
  switchport trunk allowed vlan 1,2,10,200,1002-1005
  switchport mode trunk
  no shutdown
 end"; \
done

$ for n in 3 4;do \
  echo "
 configure terminal
 !
 hostname C${n}
 !
 interface FastEthernet1/0
  shutdown
  ip address 192.168.0.${n} 255.255.255.0
  no shutdown
 end"; \
done

■CDPの確認

C3#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R1               Fas 1/0            131         R S       3620      Fas 1/0

R1#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2               Fas 1/15           118         R S       3620      Fas 1/15
R2               Fas 1/14           117         R S       3620      Fas 1/14
C3               Fas 1/0            157         R S       3620      Fas 1/0

R2#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R1               Fas 1/15           162         R S       3620      Fas 1/15
R1               Fas 1/14           161         R S       3620      Fas 1/14
C4               Fas 1/0            163         R S       3620      Fas 1/0

C4#show cdp neighbors 
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
R2               Fas 1/0            128         R S       3620      Fas 1/0

■

R1#show vlan-switch | include VLAN0010
10   VLAN0010                         active    Fa1/0

R2#show vlan-switch | include VLAN0010
10   VLAN0010                         active    Fa1/0

R1#show interfaces trunk 

Port      Mode         Encapsulation  Status        Native vlan
Po1       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Po1       1-2,10,200,1002-1005

Port      Vlans allowed and active in management domain
Po1       1,10

Port      Vlans in spanning tree forwarding state and not pruned
Po1       1,10

R2#show interfaces trunk 

Port      Mode         Encapsulation  Status        Native vlan
Po1       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Po1       1-2,10,200,1002-1005

Port      Vlans allowed and active in management domain
Po1       1,10

Port      Vlans in spanning tree forwarding state and not pruned
Po1       1,10

■Port-channelの確認

R1#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1     Po1(SU)     Fa1/14(P)  Fa1/15(P)  

R2#show etherchannel summary 
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        R - Layer3      S - Layer2
        U - in use
Group Port-channel  Ports
-----+------------+-----------------------------------------------------------
1     Po1(SU)     Fa1/14(P)  Fa1/15(P)  

■pingは端から端まで通れば良い。

C4#ping 192.168.0.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/411/1976 m

C4#show ip arp     
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.0.1             0   cc01.1c2b.0000  ARPA   FastEthernet1/0
Internet  192.168.0.2             3   cc02.1c2b.0000  ARPA   FastEthernet1/0
Internet  192.168.0.3             2   cc00.1c2b.0010  ARPA   FastEthernet1/0
Internet  192.168.0.4             -   cc03.1c2b.0010  ARPA   FastEthernet1/0

C3#ping 192.168.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms
C3#show ip arp     
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.0.1            13   cc01.1c2b.0000  ARPA   FastEthernet1/0
Internet  192.168.0.2             5   cc02.1c2b.0000  ARPA   FastEthernet1/0
Internet  192.168.0.3             -   cc00.1c2b.0010  ARPA   FastEthernet1/0
Internet  192.168.0.4             1   cc03.1c2b.0010  ARPA   FastEthernet1/0

■おまけ。telnetを設定して互いにログインしてみる。

configure terminal
 line vty 0 4
 password cisco
 login
 enable secret cisco
 end


C4(config)# end
C4#
*Mar  1 00:35:17.195: %SYS-5-CONFIG_I: Configured from console by console
C4#telnet 192.168.0.3
Trying 192.168.0.3 ... Open


User Access Verification

Password: 
C3>exit

[Connection to 192.168.0.3 closed by foreign host]

C3#telnet 192.168.0.3 
Trying 192.168.0.3 ... Open


User Access Verification

Password: 
C3>exit

[Connection to 192.168.0.3 closed by foreign host

■トポロジーは以下。

$ cat GNS3/Projects/L2-PortChannel/topology.net 
autostart = False
version = 0.8.7
[127.0.0.1:7200]
    workingdir = /tmp
    udp = 10001
    [[3620]]
        image = /home/labunix/GNS3/Images/ios/c3620-is-mz.123-1.image
        idlepc = 0x603d5308
        sparsemem = True
        ghostios = True
        chassis = 3620
    [[ROUTER C3]]
        model = 3620
        console = 2103
        aux = 2503
        cnfg = configs/C3.recovered.cfg
        slot0 = NM-1FE-TX
        slot1 = NM-1FE-TX
        f1/0 = R1 f1/0
        symbol = computer
        x = -298.0
        y = 18.0
        z = 1.0
    [[ROUTER R1]]
        model = 3620
        console = 2101
        aux = 2501
        cnfg = configs/R1.recovered.cfg
        slot0 = NM-1FE-TX
        slot1 = NM-16ESW
        f1/0 = C3 f1/0
        f1/14 = R2 f1/14
        f1/15 = R2 f1/15
        x = -177.0
        y = -180.0
        z = 1.0
    [[ROUTER R2]]
        model = 3620
        console = 2102
        aux = 2502
        cnfg = configs/R2.recovered.cfg
        slot0 = NM-1FE-TX
        slot1 = NM-16ESW
        f1/0 = C4 f1/0
        f1/14 = R1 f1/14
        f1/15 = R1 f1/15
        x = 0.0
        y = -182.0
        z = 1.0
    [[ROUTER C4]]
        model = 3620
        console = 2104
        aux = 2504
        cnfg = configs/C4.recovered.cfg
        slot0 = NM-1FE-TX
        slot1 = NM-1FE-TX
        f1/0 = R2 f1/0
        symbol = computer
        x = 113.0
        y = 32.0
        z = 1.0
[GNS3-DATA]
    configs = configs