admin
30-06-2005, 03:11 PM
Cấu hình stateless autoconfiguration
Một điểm mạnh của Ipv6 đó là có thể tự động cấu hình địa chỉ cho host.
http://vnpro.org/forum/files/ip6/1.JPG
Trong sơ đồ trên thì ta sẽ cấu R1 và R2 chạy RIPng.
Các host sẽ tự động lấy địa chỉ trong subnet của interface ethernet.
B1: Cấu hình cho router:
- Trên cổng ethernet ta phải cấu hình dải địa chỉ để cung cấp cho host, trong dải địa chỉ để cung cấp này cần chú ý là prefix phải là /64 thì host mới nhận.
- Cấu hình địa chỉ cho interface e0
- Router(config-if)#ipv6 enable: cho phép router nhận địa chỉ local link từ mac address
- Router(config-if)#ipv6 add address/prefix : Cấu hình địa chị unique global cho interface
- Router(config-if)#ipv6 nd prefix-advertisement prefix on-link autoconfiguration :Lệnh này cho phép router tạo RA
- Ex: Router1#show run int e0/0
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 nd prefix-advertisement 2001:1::/64 3000 3000 onlink autoconfig
ipv6 rip cuong enable
Kiểm tra cấu hình trên R1,R2
R1#show run
Building configuration...
Current configuration : 844 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
enable password cisco
memory-size iomem 10
ip subnet-zero
ipv6 unicast-routing
voice call carrier capacity active
mta receive maximum-recipients 0
!
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 nd prefix-advertisement 2001:1::/64 3000 3000 onlink autoconfig
ipv6 rip cuong enable
!
interface Serial0/0
no ip address ipv6 address 2001:2::1/48
ipv6 rip cuong enable
no fair-queue
!
interface Serial0/1
no ip address
shutdown
!
ip classless
ip http server
!
!
ipv6 router rip cuong
!
!call rsvp-sync
!
!
mgcp profile default
!
dial-peer cor custom
!
!
line con 0
line aux 0
line vty 0 4
no login
!
!
End
Kiểm tra bảng route R2
R1#show ipv6 route
IPv6 Routing Table - 9 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
Timers: Uptime/Expires
L 2001:1::1/128 [0/0]
via ::, Ethernet0/0, 00:36:11/never
C 2001:1::/64 [0/0]
via ::, Ethernet0/0, 00:36:12/never
R 2001:1::/48 [120/16], holddown expires in 52 secs
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/now
L 2001:2::1/128 [0/0]
via ::, Serial0/0, 00:39:16/never
C 2001:2::/48 [0/0]
via ::, Serial0/0, 00:39:19/never
R 2001:3::/64 [120/2]
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/00:02:59
L FE80::/10 [0/0]
via ::, Null0, 00:53:47/never
R FEC1::/64 [120/16], holddown expires in 52 secs
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/now
L FF00::/8 [0/0]
via ::, Null0, 00:53:47/never
R2#show run
Building configuration...
Current configuration : 987 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
logging queue-limit 100
enable password cisco
!
memory-size iomem 10
ip subnet-zero
no ip domain lookup
!
ipv6 unicast-routing
mpls ldp logging neighbor-changes
!
no voice hpi capture buffer
no voice hpi capture destination
mta receive maximum-recipients 0
!
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 nd managed-config-flag
ipv6 nd other-config-flag
ipv6 rip cuong enable
no keepalive
!
interface Serial0/0
no ip address
ipv6 address 2001:2::2/48
ipv6 rip cuong enable
clockrate 64000
no fair-queue
!
interface Serial0/1
no ip address
shutdown
!
ip http server
ip classless
ipv6 router rip cuong
call rsvp-sync
mgcp profile default
!
dial-peer cor custom
line con 0
logging synchronous
line aux 0
line vty 0 4
no login
end
Kiểm tra bảng route R2
R2#show ipv6 route
IPv6 Routing Table - 7 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
R 2001:1::/64 [120/2]
via FE80::205:5EFF:FEA4:F9C0, Serial0/0
C 2001:2::/48 [0/0]
via ::, Serial0/0
L 2001:2::2/128 [0/0]
via ::, Serial0/0
C 2001:3::/64 [0/0]
via ::, Ethernet0/0
L 2001:3::1/128 [0/0]
via ::, Ethernet0/0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
B2 Cấu hình cho host
- Trước hết ta enable ipv6 trên host
Start -> run -> command - > ipv6 install
http://vnpro.org/forum/files/ip6/2.JPG
- Ta sử dụng netsh để kiểm tra cấu hình của host cho dể.
Start ->run -> command ->netsh interface ipv6 hoặc làm từng bước như sau:
Netsh -> interface -> ipv6
Reset: tương tự ipconfig/renew bên ipv4
Renew: để lấy địa chỉ mới
Show add: Xem địa chỉ
http://vnpro.org/forum/files/ip6/3.JPG
- Test thử đứng ở host1 ping e0/0 của R2
http://vnpro.org/forum/files/ip6/4.JPG
Một điểm mạnh của Ipv6 đó là có thể tự động cấu hình địa chỉ cho host.
http://vnpro.org/forum/files/ip6/1.JPG
Trong sơ đồ trên thì ta sẽ cấu R1 và R2 chạy RIPng.
Các host sẽ tự động lấy địa chỉ trong subnet của interface ethernet.
B1: Cấu hình cho router:
- Trên cổng ethernet ta phải cấu hình dải địa chỉ để cung cấp cho host, trong dải địa chỉ để cung cấp này cần chú ý là prefix phải là /64 thì host mới nhận.
- Cấu hình địa chỉ cho interface e0
- Router(config-if)#ipv6 enable: cho phép router nhận địa chỉ local link từ mac address
- Router(config-if)#ipv6 add address/prefix : Cấu hình địa chị unique global cho interface
- Router(config-if)#ipv6 nd prefix-advertisement prefix on-link autoconfiguration :Lệnh này cho phép router tạo RA
- Ex: Router1#show run int e0/0
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 nd prefix-advertisement 2001:1::/64 3000 3000 onlink autoconfig
ipv6 rip cuong enable
Kiểm tra cấu hình trên R1,R2
R1#show run
Building configuration...
Current configuration : 844 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
enable password cisco
memory-size iomem 10
ip subnet-zero
ipv6 unicast-routing
voice call carrier capacity active
mta receive maximum-recipients 0
!
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:1::1/64
ipv6 enable
ipv6 nd prefix-advertisement 2001:1::/64 3000 3000 onlink autoconfig
ipv6 rip cuong enable
!
interface Serial0/0
no ip address ipv6 address 2001:2::1/48
ipv6 rip cuong enable
no fair-queue
!
interface Serial0/1
no ip address
shutdown
!
ip classless
ip http server
!
!
ipv6 router rip cuong
!
!call rsvp-sync
!
!
mgcp profile default
!
dial-peer cor custom
!
!
line con 0
line aux 0
line vty 0 4
no login
!
!
End
Kiểm tra bảng route R2
R1#show ipv6 route
IPv6 Routing Table - 9 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
Timers: Uptime/Expires
L 2001:1::1/128 [0/0]
via ::, Ethernet0/0, 00:36:11/never
C 2001:1::/64 [0/0]
via ::, Ethernet0/0, 00:36:12/never
R 2001:1::/48 [120/16], holddown expires in 52 secs
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/now
L 2001:2::1/128 [0/0]
via ::, Serial0/0, 00:39:16/never
C 2001:2::/48 [0/0]
via ::, Serial0/0, 00:39:19/never
R 2001:3::/64 [120/2]
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/00:02:59
L FE80::/10 [0/0]
via ::, Null0, 00:53:47/never
R FEC1::/64 [120/16], holddown expires in 52 secs
via FE80::208:E3FF:FE1B:9D40, Serial0/0, 00:02:42/now
L FF00::/8 [0/0]
via ::, Null0, 00:53:47/never
R2#show run
Building configuration...
Current configuration : 987 bytes
!
version 12.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
logging queue-limit 100
enable password cisco
!
memory-size iomem 10
ip subnet-zero
no ip domain lookup
!
ipv6 unicast-routing
mpls ldp logging neighbor-changes
!
no voice hpi capture buffer
no voice hpi capture destination
mta receive maximum-recipients 0
!
interface Ethernet0/0
no ip address
half-duplex
ipv6 address 2001:3::1/64
ipv6 enable
ipv6 nd managed-config-flag
ipv6 nd other-config-flag
ipv6 rip cuong enable
no keepalive
!
interface Serial0/0
no ip address
ipv6 address 2001:2::2/48
ipv6 rip cuong enable
clockrate 64000
no fair-queue
!
interface Serial0/1
no ip address
shutdown
!
ip http server
ip classless
ipv6 router rip cuong
call rsvp-sync
mgcp profile default
!
dial-peer cor custom
line con 0
logging synchronous
line aux 0
line vty 0 4
no login
end
Kiểm tra bảng route R2
R2#show ipv6 route
IPv6 Routing Table - 7 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
R 2001:1::/64 [120/2]
via FE80::205:5EFF:FEA4:F9C0, Serial0/0
C 2001:2::/48 [0/0]
via ::, Serial0/0
L 2001:2::2/128 [0/0]
via ::, Serial0/0
C 2001:3::/64 [0/0]
via ::, Ethernet0/0
L 2001:3::1/128 [0/0]
via ::, Ethernet0/0
L FE80::/10 [0/0]
via ::, Null0
L FF00::/8 [0/0]
via ::, Null0
B2 Cấu hình cho host
- Trước hết ta enable ipv6 trên host
Start -> run -> command - > ipv6 install
http://vnpro.org/forum/files/ip6/2.JPG
- Ta sử dụng netsh để kiểm tra cấu hình của host cho dể.
Start ->run -> command ->netsh interface ipv6 hoặc làm từng bước như sau:
Netsh -> interface -> ipv6
Reset: tương tự ipconfig/renew bên ipv4
Renew: để lấy địa chỉ mới
Show add: Xem địa chỉ
http://vnpro.org/forum/files/ip6/3.JPG
- Test thử đứng ở host1 ping e0/0 của R2
http://vnpro.org/forum/files/ip6/4.JPG