展会信息港展会大全

ipv6中配置地址的几种方法
来源:互联网   发布日期:2012-03-28 18:37:28   浏览:14844次  

导读:ipv6中获得ip的几种方式: 1. 手动配置,命令:ipv6 address xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/nn 2. stateless autoconfiguration,过程如下:(假设r1已经在与host1互联的接口上配置好了一个global unicast address) a. host1通过r1的RA发现这条链...

  ipv6中获得ip的几种方式:

  1. 手动配置,命令:ipv6 address xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx/nn

  2. stateless autoconfiguration,过程如下:(假设r1已经在与host1互联的接口上配置好了一个global unicast address)

  a. host1通过r1的RA发现这条链路上的prefix

  b. host1生成一个interface id,并添加在prefix的后面

  c. host1通过DAD判断这个地址是否唯一,如果唯一则使用次地址。

  cisco的路由器可以通过关闭RA来禁止stateless autoconfiguration,命令:ipv6 nd suppress-ra,默认这个命令是关闭的。

  由于有了stateless autoconfiguration,那么一个企业更换sp的时候就不需要手动在每台pc上更换地址,而只要将路由器上每个接口的prefix改掉就可以了。并且cisco还提供了一个接口级的命令:ipv6 nd prefix at ,这样就可以设置在某一时间自动更改接口的prefix。(注,这个命令需要时间的准确性,可惜的是cisco的设备还不支持ipv6的ntp)

  3. stateful dhcp,功能较强两种方式都更为强大。默认情况下,cisco路由器使用RA发送有关stateless autoconfiguration的信息,如果想只使用stateful dhcp,那么需要输入接口命令:ipv6 nd managed-config-flag(但不推见这样做)

  4. dhcp-pd(dhcp prefix delegation),地址委派。在pe-ce的简单环境下,只需要在pe配置好ipv6的地址和ipv6 dhcp池,那么ce就可以直接通过dhcp获得接口地址,并且在其下联接口上仍然可以获得dhcp池中的地址。这样做也是为了方便用户更换sp。

  *但在实际的运营中,还是第一种方法最为可靠保险。

  dhcp-pd和stateless autoconfiguration的配置

  R1

  hostname R1

  !

  ipv6 unicast-routing

  !

  interface Ethernet1/1

  no ip address

  duplex full

  ipv6 address test ::C800:5AFF:FE3F:1D/64

  ipv6 enable

  !

  interface Ethernet1/2

  duplex full

  ipv6 address autoconfig default

  ipv6 enable

  ipv6 dhcp client pd test

  R2

  hostname R2

  !

  ipv6 unicast-routing

  ipv6 dhcp pool test

  prefix-delegation pool test

  !

  interface Ethernet1/1

  duplex full

  ipv6 address 2001::C800:5AFF:FE40:1D/64

  ipv6 enable

  ipv6 dhcp server test

  !

  ipv6 local pool test 2001:1::/48 64

  R1

  R1#sho ipv6 interface e1/2

  Ethernet1/2 is up, line protocol is up

  IPv6 is enabled, link-local address is FE80::C800:5AFF:FE3F:1E

  Global unicast address(es):

  2001::C800:5AFF:FE3F:1E, subnet is 2001::/64 [PRE]

  valid lifetime 2591870 preferred lifetime 604670

  Joined group address(es):

  FF02::1

  FF02::2

  FF02::1:FF3F:1E

  MTU is 1500 bytes

  ICMP error messages limited to one every 100 milliseconds

  ICMP redirects are enabled

  ND DAD is enabled, number of DAD attempts: 1

  ND reachable time is 30000 milliseconds

  ND advertised reachable time is 0 milliseconds

  ND advertised retransmit interval is 0 milliseconds

  ND router advertisements are sent every 200 seconds

  ND router advertisements live for 1800 seconds

  Hosts use stateless autoconfig for addresses.

  R1#

  R1#sho ipv6 dhcp interface e1/2

  Ethernet1/2 is in client mode

  State is OPEN

  Renew will be sent in 3d08h

  List of known servers:

  Reachable via address: 2001::C800:5AFF:FE40:1D

  DUID: 00030001CA005A400000

  Preference: 0

  Configuration parameters:

  IA PD: IA ID 0x00060001, T1 302400, T2 483840

  Prefix: 2001:1::/64

  preferred lifetime 604800, valid lifetime 2592000

  expires at Nov 24 2006 08:23 PM (2580964 seconds)

  Prefix name: test

  Rapid-Commit: disabled

  R1#

  R1#sho 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, IS - ISIS summary

  O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2

  ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2

  S ::/0 [1/0]

  via FE80::C800:5AFF:FE40:1D, Ethernet1/2

  C 2001::/64 [0/0]

  via ::, Ethernet1/2

  L 2001::C800:5AFF:FE3F:1E/128 [0/0]

  via ::, Ethernet1/2

  C 2001:1::/64 [0/0]

  via ::, Ethernet1/1

  L 2001:1::C800:5AFF:FE3F:1D/128 [0/0]

  

赞助本站

人工智能实验室
AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港