- 작성시간 : 2011/09/26 20:45
- 퍼머링크 : mcchae.egloos.com/10781463
- 덧글수 : 4
기존에 IPv4 네트워크에서 시스코 카탈리스트 스위치를 VLAN 두개로 나누어
네트워크 L3 테스팅을 진행하고는 했었는데, 이번에 IPv6로 동일한 환경을 구축하여
테스트를 진행하는데 대여섯시간 정도 소요가 되었습니다.
아마 아직도 더 알아야 할 상황이 많이 있겠지만 일단 환경 자체는 구현된 듯하여
정리해 봅니다.
1) IPv6를 위한 스위치 펌웨어 업그레이드 실시
일단 스위치에 콘솔로 접속하여
Switch# show version
명령을 치면,
...
Cisco IOS Software, C3560 Software (C3560-IPSERVICES-M), Version 12.2(25)SEB4, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
...
System image file is "flash:c3560-ipservices-mz.122-25.SEB4.bin"
와 같이 나옵니다만,
Switch# conf t
Switch(config)# ipv6 ?
명령을 해 보면 그런 명령이 없다고 나옵니다.
결론은 새로운 펌웨어로 업그레드 시켜야 합니다.
현재 날짜(2011/09/26)로 가장 최신의 펌페어는 시스코에 들어가서 다운로드 받은 것은,
c3560-ipservicesk9-mz.122-58.SE2.bin
이었습니다.
이것을 다른 우분투 서버에 tftp 서버를 구축해 놓고 해당 펌웨어를 가져다 놓고 tftp client로 가져올 수 있게 준비하였습니다.
다시 스위치 콘솔에서,
Switch#dir flash:
Directory of flash:/
2 -rwx 1516 Mar 1 1993 00:03:32 +00:00 vlan.dat
3 -rwx 5 Mar 1 1993 00:06:36 +00:00 private-config.text
4 -rwx 6398853 Mar 8 1993 18:01:01 +00:00 c3560-ipservices-mz.122-25.SEB4.bin
5 drwx 0 Mar 5 1993 02:33:01 +00:00 crashinfo_ext
7 drwx 192 Mar 1 1993 00:09:06 +00:00 c3560-ipbase-mz.122-35.SE5
465 drwx 64 Mar 1 1993 00:01:24 +00:00 crashinfo
467 -rwx 2546 Mar 7 1993 03:04:09 +00:00 cqlab_ext_switch_config
468 -rwx 2107 Mar 1 1993 00:06:36 +00:00 config.text
이 중에서,
Switch# delete flash:c3560-ipservices-mz.122-25.SEB4.bin
Switch#delete /force /recursive flash:c3560-ipbase-mz.122-35.SE5
와 같이 이전 펌웨어와 폴더를 삭제합니다.
Switch#copy tftp flash:
Address or name of remote host []? 40.50.60.225
Source filename []? c3560-ipservicesk9-mz.122-58.SE2.bin
Destination filename [c3560-ipservicesk9-mz.122-58.SE2.bin]?
Accessing tftp://40.50.60.225/c3560-ipservicesk9-mz.122-58.SE2.bin...
Loading c3560-ipservicesk9-mz.122-58.SE2.bin from 40.50.60.225 (via Vlan20): !!!!!!...
위와 같이 해당 펌웨어를 tftp로 가져온 다음,
Switch#conf t
Switch(config)#boot system flash:c3560-ipservicesk9-mz.122-58.SE2.bin
Switch(config)#end
Switch#show boot
BOOT path-list : flash:c3560-ipservicesk9-mz.122-58.SE2.bin
위와 같이 다음 재시동을 하면 새로운 펌웨어로부터 부팅하도록 합니다.
Switch#reload
Proceed with reload? [confirm]
위에까지 정상적으로 되면 스위치 업그레이드 완성됩니다.
2) 스위치 IPv6 설정
처음에 스위치는 IPv6를 사용하도록 설정되어 있지 않습니다.
이를 설정하기 위해서는
Switch#conf t
Switch(config)#sdm prefer dual-ipv4-and-ipv6 routing
Switch(config)#end
Switch#wr mem
Switch#reload
위와 같이 설정하여 ipv6를 사용할 수 있도록 합니다.
기존에 초기화 된 L2였을 경우, VLAN 10, 20번이 있었고,
포트 1~12를 vlan 10에, 포트 13~24를 vlan 20에 할당을 합니다.
Switch#conf t
Switch(config)#int range g 0/1 - 12
Switch(config-range)#switchport access vlan 10
Switch(config-range)#end
Switch#conf t
Switch(config)#int range g 0/13 - 24
Switch(config-range)#switchport access vlan 20
Switch(config-range)#end
이제 ipv6 주소를 vlan 10, 20에 할당 합니다.
Switch#conf t
Switch(config)#int vlan 10
Switch(config-int)#ipv6 address 2001:10::1/64
Switch(config-int)#ipv6 enable
Switch(config-int)#end
Switch#conf t
Switch(config)#int vlan 20
Switch(config-int)#ipv6 address 2001:20::1/64
Switch(config-int)#ipv6 enable
Switch(config-int)#end
VLAN 간 라우팅이 가능하도록 합니다.
Switch#conf t
Switch(config)# ip routing
Switch(config)# ipv6 unicast-routing
Switch(config-int)#end
만약 static routing을 설정하려고 하면,
Switch#conf t
Switch(config)# ipv6 route 2001:30::/64 2001:10:90
Switch(config)# end
위의 내용은 DIP가 2001:30::/64 영역대에 속해 있으면 이것을
2001:10::/64에 물려있는 2001:10:90 IP로 static routing을 하라는 의미입니다.
설정이 끝나면 아래와 같이 명령을 내려,
reboot 되더라도 기존 설정이 살아있게 합니다.
Switch#wr mem
Switch#copy running-config startup-config
3) 서버(우분투 서버) 설정
이제 vlan 10에 연결한 서버에서
$ sudo vi /etc/network/interfaces
...
auto eth3
iface eth3 inet6 static
address 2001:10::139
netmask 64
위와 같이 IPv6를 설정한 다음,
$ sudo /etc/init.d/networking restart
이제 해당 주소를 확인하면,
$ ip -6 addr show
...
5: eth3: <BROADCAST,MULTICAST,ALLMULTI,UP,LOWER_UP> mtu 1500 qlen 1000
inet6 2001:10::139/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::290:fbff:fe22:6503/64 scope link
valid_lft forever preferred_lft forever
...
이제 ping6를 해보면,
$ ping6 -I eth3 2001:10::1
PING 2001:10::1(2001:10::1) from 2001:10::139 eth3: 56 data bytes
64 bytes from 2001:10::1: icmp_seq=1 ttl=64 time=0.515 ms
...
잘 되는데,
$ ping6 -I eth3 2001:20::1
connect: Network is unreachable
위와 같은 오류가 발생하면,
라우팅 문제일 경우가 높다.
$ sudo ip -6 route show
2001:10::/64 dev eth3 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth3 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 0
위의 경로에 보면 default 혹은 2001:20::/64 경로가 없다.
따라서,
$ sudo ip -6 route add 2001:20::/64 via 2001:10::1
$ ip -6 route show
...
2001:20::/64 via 2001:10::1 dev eth3 metric 1024 mtu 1500 advmss 1440 hoplimit 0
...
위와 같이 대상지 경로가 들어있거나,
혹은 아예 디폴트 경로를 지정해 준다.
$ sudo ip -6 route add ::/0 via 2001:10::1
$ ip -6 route show
...
default via 2001:10::1 dev eth3 metric 1024 mtu 1500 advmss 1440 hoplimit 0
위와 같이 뒤고 나면,
$ ping6 -I eth3 2001:20::1
PING 2001:20::1(2001:20::1) from 2001:10::139 eth3: 56 data bytes
64 bytes from 2001:20::1: icmp_seq=1 ttl=64 time=0.529 ms
...
내가 붙어있는 vlan의 상대편으로도 ping6가 되고,
$ ping6 -I eth3 2001:20::225
PING 2001:20::225(2001:20::225) from 2001:10::139 eth3: 56 data bytes
64 bytes from 2001:20::225: icmp_seq=1 ttl=63 time=0.136 ms
...
wget 도 가능합니다.
$ wget -q -O - http://[2001:20::225]:226
IPv6와 다른점은 ip 대신에 [] 안에 주소를 넣는다는 것이지요.
또한 IPv4 에서는 "arp -a" 명령으로 arp 테이블을 보고 연결되어 있는 포트들의 MAC 주소를 가져왔는데요,
IPv6에서는 다음과 같이 합니다.
$ ip -6 neigh show
2001:10::1 dev eth2 lladdr 00:1f:26:b1:c3:41 router STALE
fe80::21f:26ff:feb1:c341 dev eth2 lladdr 00:1f:26:b1:c3:41 router STALE
...
위와 같이 상대편 호스트로도 L3 라우팅을 통하여 잘 통신 됨을 알 수 있습니다.
vlan 20에 붙어 있는 호스트도,
2001:10:: 대신 2001:20:: 으로 설정하고 라우팅을 지정하여
잘 됨을 알 수 있었습니다.
휴우... IPv6가 언제 활성화 될지는 모르지만, 해보니 재미있군요~ ^^
덧글
뭐 잡스 아저씨의 말이 아니더라도 필요해서 밥먹고 살려고 머리박고 해결책을 찾다보니 나오데... ^^