Can't Assign an IP to a Huawei Switch Port: Use undo portswitch
Short answer
B Run undo portswitch on GE1/0/1 to convert it into a Layer 3 routed port so it accepts an IP address
Question
Which of the following commands can you run in the interface view to resolve this problem?
Key Takeaways
The question tests Layer 2 vs Layer 3 port modes — the trap is picking a port link-type command, which changes VLAN tagging but never creates a Layer 3 interface.
When Huawei switch interface GE1/0/1 rejects an IP address, the port is still in Layer 2 switching mode; running undo portswitch in the interface view converts it to a routed port, making option B the correct answer.
Common mistake: Choosing D (or A/C) port link-type access/hybrid/trunk, because access ports seem tied to VLANs and addressing; these are Layer 2 commands that never let the interface accept an IP address.
Expert Analysis
Why the interface refuses an IP address
On a Huawei cloud-management/Campus switch, a physical GE interface defaults to Layer 2 switching mode. In that mode the port belongs to a switching VLAN bridge, so ip address is not accepted — the CLI rejects it because the port has no Layer 3 subnet interface to attach the address to. The question's failure condition ("cannot configure an IP address for GE1/0/1") is therefore a mode problem, not a link-type problem.
The attractive wrong answer
Options A, C and D all look like plausible "make the interface work" fixes, and a candidate under time pressure often reaches for port link-type access or port link-type hybrid, since access ports are the type normally paired with a VLAN that carries traffic. A comment on this item puts the trap plainly: "all other commands are l2 commands." Selecting A, C or D satisfies nothing in the question — changing the Layer 2 forwarding type never creates a Layer 3 interface, and the ip address command will still fail afterwards. These commands only decide how frames are tagged inside the VLAN, which is orthogonal to addressing.
The decisive command
undo portswitch runs in the interface view and converts the port from a switching (Layer 2) port to a routed (Layer 3) port. Once the port is switched out of Layer 2 mode, it behaves like a router interface and accepts an IP address directly. The same reasoning as the comment: "to configure an ip on a switch interface it must be an L3 interface and to do so the command is 'undo portswitch'." So option B is the correct answer; re-enable Layer 2 behaviour later with portswitch if needed.
Exam Strategy
When a question says a switch interface cannot take an IP address, immediately ask whether the port is Layer 2 or Layer 3 rather than what its VLAN tagging mode is. Eliminate every option containing port link-type, since those only govern 802.1Q tagging and cannot create a subnet interface. Then look for a mode-conversion command such as undo portswitch, and remember its reverse (portswitch) for questions that ask how to return the port to switching mode.
Frequently Asked Questions
Why does a Huawei switch interface reject the ip address command?
Does port link-type access let me assign an IP address?
How do I return GE1/0/1 to a normal Layer 2 switch port?
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 2 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 2
-
Sprea 👍 1it must be. to configure an ip an a switch interface it must be an L3 interface and to do so the command is 'undo portswitch'. all other commands are l2 commands
-
Bennnnnnn 👍 1 Answered BI think the answer is B
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.