Dell Networking SONiC:如何配置 IPv6 地址
Summary: 本文介绍如何在 Dell Networking SONiC 中配置 IPv6 地址。本文使用运行 Dell SONiC 4.1 的交换机。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
|
前提条件
我们使用标准接口命名来演示概念。请参阅戴尔文章 202172 Dell Networking S 系列:基本接口配置 - SONiC 4.0 ,了解有关接口命名的更多信息 |
指数
配置语法和显示命令
链接本地地址
IPv6 地址空间
配置
示例将 IP 地址分配给接口。
将 IP 地址分配给 VLAN。
将 IP 地址分配给 PortChannel。
将 IP 地址分配给环回接口。
提醒:配置 IPv6 地址时,链路本地地址也会默认激活。链路本地地址以 FE80:: 开启。您可以使用命令 show ipv6 interface 查看链路本地地址。
配置语法和显示命令
配置语法
| 命令 | 说明 |
|---|---|
admin@DELLSONiC:~$ sonic-cli |
输入 Dell Management 命令行界面 |
DELLSONiC# configure terminal |
进入配置模式 |
DELLSONiC(config)# interface <Eth slot/port><Vlan ID><PortChannel ID><Eth slot/port.subport><Loopback ID> |
配置接口、VLAN、PortChannel、子接口、环回。 |
DELLSONiC(conf-if-XXXX)#ipv6 enable |
在接口上启用 IPv6 转发。 |
DELLSONiC(conf-if-XXXX)#no ipv6 enable |
禁用接口上的 IPv6 转发。 |
DELLSONiC(conf-if-XXXX)# ipv6 address ipv6-prefix/prefix-length |
配置 IPv6 前缀和前缀长度。 |
DELLSONiC(conf-if-XXXX)# no ipv6 address ipv6-prefix/prefix-length |
删除 IPv6 地址。 |
DELLSONiC(conf-if-XXXX)# no shutdown |
如果接口关闭,请取消封口。 |
显示命令以验证 IPv6 地址。
| 命令 | 说明 |
|---|---|
admin@DELLSONiC:~$ sonic-cli |
输入 Dell Management 命令行界面 |
DELLSONiC# configure terminal |
进入配置模式 |
DELLSONiC# show ipv6 interfaces |
显示在接口中配置的 IP。 |
DELLSONiC# show running-configuration interface <Eth slot/port><Vlan ID><PortChannel ID><Loopback ID> |
显示接口配置 |
链接本地地址
IPv6 链路本地地址用于与本地网络中的节点通信。IPv6 链路本地地址在 RFC 4291 下定义。下面是我们在 Dell SONiC 中必须了解的有关 IPv6 链路本地地址的关键点?
- 地址块 fe80::/10 保留用于 IPv6 链路本地地址。
- 在接口上配置 IPv6 地址时,将自动生成链路本地地址。
- 我们无法分配静态链路本地地址。
- 从接口中删除 IPv6 地址时,链路本地地址也会被删除。
DELLSONiC# show ipv6 interfaces Flags: U-Unnumbered interface, A-Anycast IP ----------------------------------------------------------------------------------------------------------------- Interface IP address/mask VRF Admin/Oper Flags ----------------------------------------------------------------------------------------------------------------- Management0 fe80::XXXX:XXXX:XXXX:XXXX/64 up/down Eth1/1 3000::1/64 up/up Eth1/1 fe80::XXXX:XXXX:XXXX:XXXX/64 up/up |
IPv6 地址空间
| IPv6 前缀 | 分配 |
|---|---|
| 2000::/3 | 全球单播 |
| fe80::/10 | 链接范围单播 |
| ff00::/8 | 组 播 |
| 0000::/8 | 由 IETF 保留 |
| 0100::/8 | 由 IETF 保留 |
| 0200::/7 | 由 IETF 保留 |
| 0400::/6 | 由 IETF 保留 |
| 0800::/5 | 由 IETF 保留 |
| 1000::/4 | 由 IETF 保留 |
| 4000::/3 | 由 IETF 保留 |
| 6000::/3 | 由 IETF 保留 |
| 8000::/3 | 由 IETF 保留 |
| a000::/3 | 由 IETF 保留 |
| c000::/3 | 由 IETF 保留 |
| e000::/4 | 由 IETF 保留 |
| f000::/5 | 由 IETF 保留 |
| f800::/6 | 由 IETF 保留 |
| fe00::/9 | 由 IETF 保留 |
| fec0::/10 | 由 IETF 保留 |
| fc00::/7 | 独特的本地单播 |
由 Internet 分配的数字授权 (IANA)、Internet 协议版本 6 地址空间提供
示例配置
将 IP 地址分配给接口。
让我们将 IPv6 地址 3000::1/64 分配给接口 Eth 1/1。 admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# interface Eth 1/1 DELLSONiC(config-if-Eth1/1)# ipv6 address 3000::1/64 DELLSONiC(config-if-Eth1/1)# end DELLSONiC# |
让我们检查分配给接口 Eth 1/1 的 IPv6 地址。
DELLSONiC# show ipv6 interfaces Flags: U-Unnumbered interface, A-Anycast IP ----------------------------------------------------------------------------------------------------------------- Interface IP address/mask VRF Admin/Oper Flags ----------------------------------------------------------------------------------------------------------------- Management0 fe80::XXXX:XXXX:XXXX:XXXX/64 up/down Eth1/1 3000::1/64 up/up Eth1/1 fe80::XXXX:XXXX:XXXX:XXXX/64 up/up |
DELLSONiC# show running-configuration interface Eth 1/1 ! interface Eth1/1 mtu 9100 no shutdown ipv6 address 3000::1/64 |
将 IP 地址分配给 VLAN。
让我们将 IPv6 地址 3000::1/64 分配给接口 VLAN1。 admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# interface Vlan 1 DELLSONiC(config-if-Vlan1)# ipv6 address 3000::1/64 DELLSONiC(config-if-Vlan1)# end DELLSONiC# |
让我们检查分配给接口 VLAN1 的 IPv6 地址。
DELLSONiC# show ipv6 interfaces Flags: U-Unnumbered interface, A-Anycast IP ----------------------------------------------------------------------------------------------------------------- Interface IP address/mask VRF Admin/Oper Flags ----------------------------------------------------------------------------------------------------------------- Management0 fe80::XXXX:XXXX:XXXX:XXXX/64 up/down Vlan1 3000::1/64 up/up Vlan1 fe80::XXXX:XXXX:XXXX:XXXX/64 up/up |
DELLSONiC# show running-configuration interface Vlan 1 ! interface Vlan1 ipv6 address 3000::1/64 DELLSONiC# |
将 IP 地址分配给 PortChannel。
让我们将 IPv6 地址 3000::1/64 分配给接口 PortChannel1。 admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# interface PortChannel 1 DELLSONiC(config-if-po1)# ipv6 address 3000::1/64 DELLSONiC(config-if-po1)# end DELLSONiC# |
让我们检查分配给接口 PortChannel1 的 IPv6 地址。
DELLSONiC# show ipv6 interfaces Flags: U-Unnumbered interface, A-Anycast IP ----------------------------------------------------------------------------------------------------------------- Interface IP address/mask VRF Admin/Oper Flags ----------------------------------------------------------------------------------------------------------------- Management0 fe80::XXXX:XXXX:XXXX:XXXX/64 up/down PortChannel1 3000::1/64 up/up PortChannel1 fe80::XXXX:XXXX:XXXX:XXXX/64 up/up |
DELLSONiC# show running-configuration interface PortChannel 1 ! interface PortChannel1 no shutdown ipv6 address 3000::1/64 DELLSONiC# |
将 IP 地址分配给环回接口。
提醒:环回支持前缀长度 128。
让我们将 IPv6 地址 3000::1/128 分配给接口环回 1。
admin@DELLSONiC:~$ sonic-cli DELLSONiC# configure DELLSONiC(config)# interface Loopback 1 DELLSONiC(config-if-lo1)# ipv6 address 3000::1/128 DELLSONiC(config-if-lo1)# end DELLSONiC# |
让我们检查分配给接口环回 1 的 IPv6 地址。
DELLSONiC# show ipv6 interfaces Flags: U-Unnumbered interface, A-Anycast IP ----------------------------------------------------------------------------------------------------------------- Interface IP address/mask VRF Admin/Oper Flags ----------------------------------------------------------------------------------------------------------------- Management0 fe80::XXXX:XXXX:XXXX:XXXX/64 up/down Loopback1 3000::1/128 up/up Loopback1 fe80::XXXX:XXXX:XXXX:XXXX/64 up/up |
DELLSONiC# show running-configuration interface Loopback 1 ! interface Loopback 1 ipv6 address 3000::1/128 DELLSONiC# |
Affected Products
Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9264F-ON, PowerSwitch Z9332F-ON
, PowerSwitch Z9432F-ON
...
Article Properties
Article Number: 000219072
Article Type: How To
Last Modified: 01 Nov 2023
Version: 2
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.