DELL Networking SONiC: Konfigurera IPv4-adress och maximal överföringsenhet i Layer 3-gränssnitt

Summary: I den här artikeln förklaras hur du konfigurerar IPv4-adress och MTU-gränssnitt (Maximum Transmission Unit) i Dell Networking SONiC. I den här artikeln används en switch som kör 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

 
Förutsättningar
Vi använder standardgränssnittsnamn för att demonstrera begreppen. Läs Dell-artikeln 202172 Dell Networking S-serien: Grundläggande gränssnittskonfiguration – SONiC 4.0 för mer information om gränssnittsnamngivning


Index

Tilldela en IP-adress.

MTU
 

Tilldela en IP-adress.

Konfigurationssyntax
Kommando Förklaring
admin@DELLSONiC:~$ sonic-cli
Gå in i Dell Management kommandoradsgränssnitt
DELLSONiC# configure terminal
Gå in i konfigurationsläge
DELLSONiC(config)# interface <Eth slot/port><Vlan ID><PortChannel ID><Eth slot/port.subport><Loopback ID>
Konfigurera gränssnitt, VLAN, PortChannel, undergränssnitt, loopback.
DELLSONiC(conf-if-XXXX)# ip address A.B.C.D/mask
Konfigurera IP-adress med mask.
DELLSONiC(conf-if-XXXX)# no ip address A.B.C.D/mask
Ta bort IP-adressen.
DELLSONiC(conf-if-XXXX)# no shutdown
Om gränssnittet är avstängt stänger du av gränssnittet.

Visa ett kommando för att verifiera IP-adressen.
Kommando Förklaring
admin@DELLSONiC:~$ sonic-cli
Gå in i Dell Management kommandoradsgränssnitt
DELLSONiC# configure terminal
Gå in i konfigurationsläge
DELLSONiC# show ip interfaces
Visa IP-adress konfigurerad i gränssnitt.
DELLSONiC# show running-configuration interface <Eth slot/port><Vlan ID><PortChannel ID><Loopback ID> 
Visa gränssnittskonfiguration
 
Låt oss konfigurera en IP-adress på gränssnittet Eth 1/1 med IP-adress 10.0.0.1/24.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# ip address 10.0.0.1/24
DELLSONiC(config-if-Eth1/1)# end
DELLSONiC#

Vi ska nu kontrollera konfigurationen.
DELLSONiC# show ip interfaces
Flags: U-Unnumbered interface, A-Anycast IP
-----------------------------------------------------------------------------------------------------------------
Interface            IP address/mask                              VRF                 Admin/Oper     Flags
-----------------------------------------------------------------------------------------------------------------
Eth1/1               10.0.0.1/24                                                      up/up
DELLSONiC# show running-configuration interface Eth 1/1
!
interface Eth1/1
 mtu 9100
 no shutdown
 ip address 10.0.0.1/24
DELLSONiC#

 

Vi ska konfigurera IP-adressen på VLAN 1 med IP-adressen 10.0.0.1/24.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface Vlan 1
DELLSONiC(config-if-Vlan1)# ip address 10.0.0.1/24
DELLSONiC(config-if-Vlan1)# end
DELLSONiC#

Vi ska nu kontrollera konfigurationen.
DELLSONiC# show ip interfaces
Flags: U-Unnumbered interface, A-Anycast IP
-----------------------------------------------------------------------------------------------------------------
Interface            IP address/mask                              VRF                 Admin/Oper     Flags
-----------------------------------------------------------------------------------------------------------------
Vlan1                10.0.0.1/24                                                      up/up
DELLSONiC# show running-configuration interface Vlan 1
!
interface Vlan1
 ip address 10.0.0.1/24
 
Vi ska konfigurera IP-adress på PortChannel 1 med IP-adress 10.0.0.1/24.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1
DELLSONiC(config-if-po1)# ip address 10.0.0.1/24
DELLSONiC(config-if-po1)# end

Vi ska nu kontrollera konfigurationen.
DELLSONiC# show ip interfaces
Flags: U-Unnumbered interface, A-Anycast IP
-----------------------------------------------------------------------------------------------------------------
Interface            IP address/mask                              VRF                 Admin/Oper     Flags
-----------------------------------------------------------------------------------------------------------------
PortChannel1         10.0.0.1/24                                                      up/up
DELLSONiC# show running-configuration interface PortChannel 1
!
interface PortChannel1
 no shutdown
 ip address 10.0.0.1/24
DELLSONiC#

 

Låt oss konfigurera IP-adressen på Loopback 1 med IP-adress 10.0.0.1/32.
 
Obs! Loopback stöder endast /32-prefixlängd eller undernät.
 
 
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface Loopback 1
DELLSONiC(config-if-lo1)# ip address 10.0.0.1/32
DELLSONiC(config-if-lo1)# end
DELLSONiC#

Vi ska nu kontrollera konfigurationen.
DELLSONiC# show ip interfaces
Flags: U-Unnumbered interface, A-Anycast IP
-----------------------------------------------------------------------------------------------------------------
Interface            IP address/mask                              VRF                 Admin/Oper     Flags
-----------------------------------------------------------------------------------------------------------------
Loopback1            10.0.0.1/32                                                      up/up
DELLSONiC# show running-configuration interface Loopback 1
!
interface Loopback 1
 ip address 10.0.0.1/32
DELLSONiC#
 

Tilldela Anycast IP-adress

Se artikeln Dell Networking SONiC Konfigurera statisk Anycast-gateway (anycast-adress) om hur du konfigurerar anycast-adress. 

 

MTU

Konfigurationssyntax
Kommando Förklaring
admin@DELLSONiC:~$ sonic-cli
Gå in i Dell Management kommandoradsgränssnitt
DELLSONiC# configure terminal
Gå in i konfigurationsläge
DELLSONiC(config)# interface <Eth slot/port><Vlan ID><PortChannel ID><Eth slot/port.subport>
Konfigurera gränssnitt, VLAN, PortChannel, undergränssnitt.
DELLSONiC(conf-if-XXXX)# mtu <MTU>
Konfigurera MTU-ändring av MTU (1312 till 9216). Standard: 9100
DELLSONiC(conf-if-XXXX)# no mtu
Konfigurera standard-MTU i gränssnittet (standard är 9100).

Visa kommandon för att verifiera MTU.
Kommando Förklaring
admin@DELLSONiC:~$ sonic-cli
Gå in i Dell Management kommandoradsgränssnitt
DELLSONiC# configure terminal
Gå in i konfigurationsläge
DELLSONiC# show interface <Eth slot/port><Vlan ID><PortChannel ID>
Visa gränssnittsinformation.
DELLSONiC# show running-configuration interface <Eth slot/port><Vlan ID><PortChannel ID>
Visa gränssnittskonfiguration
DELLSONiC#show interface status
Visa gränssnittsstatus

 

  • MTU-konfigurationskommentarer

    • Konfigurera MTU på VLAN-medlemmar först innan du konfigurerar VLAN MTU. Alla medlemmar i ett VLAN måste ha samma MTU-värde. Taggade medlemmar måste ha en länk-MTU som är 4 byte högre än otaggade medlemmar för att ta hänsyn till pakettaggen.
    • Konfigurera MTU på portkanalmedlemmar först innan du konfigurerar portkanalens MTU. Alla medlemmar i en portkanal måste ha samma MTU-värde. Taggade medlemmar måste ha en länk-MTU som är 4 byte högre än otaggade medlemmar för att ta hänsyn till pakettaggen.
    • Kontrollera att MTU för portkanalmedlemmar är större än eller lika med portkanalens MTU. Om du konfigurerar MTU på portkanalmedlemmar efter att du har konfigurerat portkanalens MTU kanske portkanalens MTU inte uppdateras. Systemet väljer det lägsta MTU-värdet som har konfigurerats för portkanalen eller portkanalmedlemmarna som MTU för portkanalen. Portkanalen innehåller till exempel taggade medlemmar med Link MTU på 1522 och IP MTU på 1500 och otaggade medlemmar med Link MTU på 1518 och IP MTU på 1500. Portkanalens Link MTU får inte vara högre än 1 518 byte och dess IP MTU får inte vara högre än 1 500 byte.
Låt oss konfigurera MTU i gränssnitt Eth 1/1.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface Eth 1/1
DELLSONiC(config-if-Eth1/1)# mtu 1500
DELLSONiC(config-if-Eth1/1)# end

Låt oss verifiera konfigurationen (Output Grepped för korthet).
DELLSONiC# show interface status
--------------------------------------------------------------------------------------------------------------------------------------
Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name
--------------------------------------------------------------------------------------------------------------------------------------
Eth1/1              -                             up             oper-up        off       25000          1500           Ethernet0
DELLSONiC# show running-configuration interface Eth 1/1
!
interface Eth1/1
 mtu 1500
 no shutdown
DELLSONiC# show interface Eth 1/1

Eth1/1 is up, line protocol is up, reason oper-up
Hardware is Eth, address is xx:xx:xx:xx:xx:xx
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Interface IPv6 oper status: Disabled
IP MTU 1500 bytes
LineSpeed 25GB, Auto-negotiation off
Link-training: off

 

Vi ska nu konfigurera MTU i VLAN-gränssnittet.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface Vlan 1
DELLSONiC(config-if-Vlan1)# mtu 1500
DELLSONiC(config-if-Vlan1)# end
DELLSONiC#

Låt oss verifiera konfigurationen (Output Grepped för korthet).
DELLSONiC# show interface Vlan 1

Vlan1 is up, line protocol is up
Hardware is Vlan, address is xx:xx:xx:xx:xx:xx
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Interface IPv6 oper status: Disabled
IP MTU 1500 bytes
Time since last interface status change: 02:33:17
DELLSONiC# show running-configuration interface Vlan 1
!
interface Vlan1
 mtu 1500

 

Vi ska nu konfigurera PortChannel 1 med MTU 1500.
admin@DELLSONiC:~$ sonic-cli
DELLSONiC# configure
DELLSONiC(config)# interface PortChannel 1
DELLSONiC(config-if-po1)# mtu 1500
DELLSONiC(config-if-po1)# end
DELLSONiC#

Låt oss verifiera konfigurationen (Output Grepped för korthet).
DELLSONiC# show running-configuration interface PortChannel 1
!
interface PortChannel1 mode on
 mtu 1500
 no shutdown
DELLSONiC# show interface status
--------------------------------------------------------------------------------------------------------------------------------------
Name                Description                   Oper           Reason         AutoNeg   Speed          MTU            Alternate Name
--------------------------------------------------------------------------------------------------------------------------------------
Eth1/1              -                             up             oper-up        off       25000          1500           Ethernet0
Eth1/2              -                             up             oper-up        off       25000          1500           Ethernet1


PortChannel1        -                             up             oper-up        -         25000          1500           -
DELLSONiC# show interface PortChannel 1
PortChannel1 is up, line protocol is up, reason oper-up, mode Static
Hardware is PortChannel, address is xx:xx:xx:xx:xx:xx
Minimum number of links to bring PortChannel up is 1
Mode of IPV4 address assignment: not-set
Mode of IPV6 address assignment: not-set
Graceful shutdown: Disabled
MTU 1500
LineSpeed 25.0GB
Events:

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: 000218581
Article Type: How To
Last Modified: 10 Apr 2024
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.