所选语种没有对应资源,请选择:

本站点使用Cookies,继续浏览表示您同意我们使用Cookies。Cookies和隐私政策>

提示

尊敬的用户,您的IE浏览器版本过低,为获取更好的浏览体验,请升级您的IE浏览器。

升级

S7700, S9700 V200R010C00 配置指南-IP业务

本文档介绍了IP业务的配置,具体包括IP地址配置、ARP配置、DHCP配置、DNS配置、mDNS网关配置、mDNS中继配置、UDP Helper配置、IP性能优化配置、IPv6基础配置、DHCPv6配置、IPv6 DNS配置、IPv6 over IPv4隧道配置和IPv4 over IPv6隧道配置。
评分并提供意见反馈 :
华为采用机器翻译与人工审校相结合的方式将此文档翻译成不同语言,希望能帮助您更容易理解此文档的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 华为对于翻译的准确性不承担任何责任,并建议您参考英文文档(已提供链接)。
配置DHCPv6服务器和DHCPv6客户端示例(DHCPv6有状态方式)

配置DHCPv6服务器和DHCPv6客户端示例(DHCPv6有状态方式)

组网需求

图10-15所示,SwitchA与SwitchB在同一条链路上。通过部署SwitchA作为DHCPv6服务器、SwitchB作为DHCPv6客户端,实现SwitchB通过DHCPv6服务器获取IPv6地址和DNS服务器地址的需求。

图10-15  DHCPv6服务器和客户端组网图

配置思路

配置思路如下:
  1. 在SwitchA上,配置DHCPv6服务器,实现为DHCPv6客户端动态分配IPv6地址和DNS服务器地址。具体配置包括:配置接口的IPv6地址、配置IPv6地址池、使能接口的DHCPv6服务器功能。

  2. 在SwitchB上,配置DHCPv6客户端功能,实现通过DHCPv6服务器动态获取IPv6地址和DNS服务器地址。具体配置包括:配置接口的IPv6功能、使能接口的DHCPv6客户端功能。

说明:

配置前请保证DHCPv6服务器与DNS服务器之间路由互通。

操作步骤

  1. 在SwitchA上,配置DHCPv6服务器

    # 配置接口的IPv6地址。

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchA
    [SwitchA] ipv6
    [SwitchA] vlan 100
    [SwitchA-vlan100] quit
    [SwitchA] interface gigabitethernet 1/0/1
    [SwitchA-GigabitEthernet1/0/1] port link-type trunk
    [SwitchA-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
    [SwitchA-GigabitEthernet1/0/1] quit
    [SwitchA] interface vlanif 100
    [SwitchA-Vlanif100] ipv6 enable
    [SwitchA-Vlanif100] ipv6 address fc00:3::1/64
    [SwitchA-Vlanif100] quit

    # 配置IPv6地址池。

    [SwitchA] dhcpv6 pool pool1
    [SwitchA-dhcpv6-pool-pool1] address prefix fc00:3::/64
    [SwitchA-dhcpv6-pool-pool1] excluded-address fc00:3::1 
    [SwitchA-dhcpv6-pool-pool1] dns-server fc00:4::1
    [SwitchA-dhcpv6-pool-pool1] quit 

    # 使能接口的DHCPv6服务器功能。

    [SwitchA] dhcp enable
    [SwitchA] interface vlanif 100
    [SwitchA-Vlanif100] dhcpv6 server pool1
    

    # 配置发布RA报文,使DHCPv6客户端通过RA报文学习到IPv6网关的缺省路由;配置发布RA报文的M和O标志位,使DHCPv6客户端通过DHCP方式获取IPv6地址和其他网络参数。

    [SwitchA-Vlanif100] undo ipv6 nd ra halt
    [SwitchA-Vlanif100] ipv6 nd autoconfig managed-address-flag
    [SwitchA-Vlanif100] ipv6 nd autoconfig other-flag
    [SwitchA-Vlanif100] quit
    [SwitchA] quit

  2. 在SwitchB上,配置DHCPv6客户端

    # 配置接口的IPv6功能。

    <HUAWEI> system-view
    [HUAWEI] sysname SwitchB
    [SwitchB] dhcp enable
    [SwitchB] ipv6
    [SwitchB] vlan 100
    [SwitchB-vlan100] quit
    [SwitchB] interface gigabitethernet 1/0/1
    [SwitchB-GigabitEthernet1/0/1] port link-type trunk
    [SwitchB-GigabitEthernet1/0/1] port trunk allow-pass vlan 100
    [SwitchB-GigabitEthernet1/0/1] quit
    [SwitchB] interface vlanif 100
    [SwitchB-Vlanif100] ipv6 enable
    [SwitchB-Vlanif100] ipv6 address auto link-local
    

    # 使能接口的DHCPv6客户端功能。

    [SwitchB-Vlanif100] ipv6 address auto dhcp
    

    # 配置DHCPv6客户端通过RA报文学习到IPv6网关的缺省路由。

    [SwitchB-Vlanif100] ipv6 address auto global default
    [SwitchB-Vlanif100] quit
    [SwitchB] quit

  3. 验证配置结果

    # 在SwitchA上,通过命令display dhcpv6 pool查看IPv6地址池pool1的配置和地址分配信息。

    <SwitchA> display dhcpv6 pool pool1
    DHCPv6 pool: pool1
      Address prefix: FC00:3::/64
        Lifetime valid 172800 seconds, preferred 86400 seconds
        1 in use, 0 conflicts
      excluded-address FC00:3::1 
      1 excluded addresses 
      Information refresh time: 86400
      DNS server address: FC00:4::1
      conflict-address expire-time: 172800
      renew-time-percent : 50
      rebind-time-percent : 80
      Active normal clients: 1
    <SwitchA> display dhcpv6 pool pool1 allocated address
    Address                                 Valid    Expires             Left
    -------------------------------------------------------------------------------
    FC00:3::2                               172800   2014-03-29 05:47:19 159594
    -------------------------------------------------------------------------------
    Total : 1 

    # 在SwitchA上,通过命令display ipv6 interface vlanif 100查看接口VLANIF100的IPv6链路本地地址,以便后续在DHCPv6客户端上查看是否生成了到IPv6网关的缺省路由。

    <SwitchA> display ipv6 interface vlanif 100                                                                                          
    Vlanif100 current state : UP                                                                                                        
    IPv6 protocol current state : UP                                                                                                    
    IPv6 is enabled, link-local address is FE80::2EAB:FF:FE98:15BB                                                                      
      Global unicast address(es):                                                                                                       
        FC00:3::1, subnet is FC00:3::/64                                                                                                
      Joined group address(es):                                                                                                         
        FF02::1:2                                                                                                                       
        FF02::1:FF00:1                                                                                                                  
        FF02::1:FF98:15BB                                                                                                               
        FF02::2                                                                                                                         
        FF02::1                                                                                                                         
    ……

    # 在SwitchB上,通过命令display dhcpv6 client查看DHCPv6客户端的配置信息。

    <SwitchB> display dhcpv6 client
    Vlanif100 is in stateful DHCPv6 client mode.
    Stateful DHCPv6 client is in BOUND state.
    Preferred server DUID   : 00030001000B099C1162
      Reachable via address : FE80::20B:9FF:FE03:AC9B
    IA NA IA ID 0x000004E1 T1 43200 T2 69120
      Obtained     : 2014-03-26 17:47:15
      Renews       : 2014-03-27 05:47:15
      Rebinds      : 2014-03-27 12:59:15
      Address      : FC00:3::2
        Lifetime valid 172800 seconds, preferred 86400 seconds
        Expires at 2014-03-28 17:47:15(172726 seconds left)
    DNS server     : FC00:4::1

    # 在SwitchB上,通过命令display ipv6 routing-table查看DHCPv6客户端上已经生成了到IPv6网关的缺省路由。

    <SwitchB> display ipv6 routing-table
    Routing Table : Public                                                                                                              
            Destinations : 4        Routes : 4                                                                                          
                                                                                                                                        
     Destination  : ::                              PrefixLength : 0                                                                    
     NextHop      : FE80::2EAB:FF:FE98:15BB         Preference   : 64                                                                   
     Cost         : 0                               Protocol     : Unr                                                                  
     RelayNextHop : ::                              TunnelID     : 0x0                                                                  
     Interface    : Vlanif100                       Flags        : D                                                                    
                                                                                                                                        
     Destination  : ::1                             PrefixLength : 128                                                                  
     NextHop      : ::1                             Preference   : 0                                                                    
     Cost         : 0                               Protocol     : Direct                                                               
     RelayNextHop : ::                              TunnelID     : 0x0                                                                  
     Interface    : InLoopBack0                     Flags        : D                                                                    
                                                                                                                                        
     Destination  : FC00:3::2                       PrefixLength : 128                                                                  
     NextHop      : ::1                             Preference   : 0                                                                    
     Cost         : 0                               Protocol     : Direct                                                               
     RelayNextHop : ::                              TunnelID     : 0x0                                                                  
     Interface    : Vlanif100                       Flags        : D                                                                    
                                                                                                                                        
     Destination  : FE80::                          PrefixLength : 10                                                                   
     NextHop      : ::                              Preference   : 0                                                                    
     Cost         : 0                               Protocol     : Direct                                                               
     RelayNextHop : ::                              TunnelID     : 0x0                                                                  
     Interface    : NULL0                           Flags        : D 

配置文件

  • SwitchA的配置文件

    #
    sysname SwitchA
    #
    ipv6
    #
    vlan batch 100
    #
    dhcp enable
    #
    dhcpv6 pool pool1
     address prefix FC00:3::/64
     excluded-address FC00:3::1
     dns-server FC00:4::1
    #
    interface Vlanif100
     ipv6 enable
     ipv6 address FC00:3::1/64
     undo ipv6 nd ra halt                                                                                                               
     ipv6 nd autoconfig managed-address-flag                                                                                            
     ipv6 nd autoconfig other-flag
     dhcpv6 server pool1
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 100
    #
    return
  • SwitchB的配置文件

    #
    sysname SwitchB
    #
    ipv6
    #
    vlan batch 100
    #
    dhcp enable
    #
    interface Vlanif100
     ipv6 enable
     ipv6 address auto link-local
     ipv6 address auto global default
     ipv6 address auto dhcp
    #
    interface GigabitEthernet1/0/1
     port link-type trunk
     port trunk allow-pass vlan 100
    #
    return
翻译
下载文档
更新时间:2019-08-21

文档编号:EDOC1000141459

浏览量:18274

下载量:840

平均得分:
本文档适用于这些产品
相关文档
相关版本
Share
上一页 下一页