How to configure interfaces in a batch

9

To perform the same configurations on multiple interfaces, add these interfaces to a port group to batch configure them. This can reduce the configuration workload.

Other related questions:
How to configure interfaces in a batch
To perform the same configurations on multiple interfaces, add these interfaces to a port group to batch configure them. This can reduce the configuration workload.

How to implement port mapping on an AR router
Run the port-mapping command on an AR router to configure port mapping based on basic ACLs (number 2000 to 2999). Port mapping is implemented after packets match an ACL rule. To filter packets based on the ACLs, port mapping tries to match the destination IP addresses in the packets with the IP addresses defined in the basic ACL rules.
Example:
# Set the mapping port of the HTTP service to 10. If packets comply with the rules defined in the ACL 2000, the mapping relationship takes effect.
system-view
[Huawei] acl 2000
[Huawei-acl-basic-2000] rule permit
[Huawei-acl-basic-2000] quit
[Huawei] port-mapping http port 10 acl 2000


How to add interfaces to a VLAN in a batch
You can add interfaces to a VLAN in a batch using a port group, and directly add access interfaces to a VLAN in a batch in the system view. Access interface # Add GE0/0/1-GE0/0/5 to VLAN 10 in a batch. Add interfaces to a VLAN in a batch using a port group. system-view [HUAWEI] port-group pg1 [HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5 [HUAWEI-port-group-pg1] port link-type access [HUAWEI-port-group-pg1] port default vlan 10 Add interfaces to a VLAN in a batch in the VLAN view. system-view [HUAWEI] vlan 10 [HUAWEI-vlan10] port gigabitethernet 0/0/1 to 0/0/5 NOTE: Before performing this operation, configure interfaces to be added to a VLAN as access interface. Trunk interface # Add GE0/0/1-GE0/0/5 to VLAN 10 and VLAN 20 in a batch. system-view [HUAWEI] port-group pg1 [HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5 [HUAWEI-port-group-pg1] port link-type trunk [HUAWEI-port-group-pg1] port trunk allow-pass vlan 10 20Hybrid interface # Add GE0/0/1-GE0/0/5 to VLAN 10 and VLAN 20 in a batch. system-view [HUAWEI] port-group pg1 [HUAWEI-port-group-pg1] group-member gigabitethernet0/0/1 to gigabitethernet0/0/5 [HUAWEI-port-group-pg1] port link-type hybrid [HUAWEI-port-group-pg1] port hybrid tagged vlan 10 [HUAWEI-port-group-pg1] port hybrid untagged vlan 20

How do I configure batch port mapping
When a private IP address and a range of consecutive port numbers need to be mapped to a public IP address and a range of consecutive port numbers, you can reference an ACL to complete batch port mapping configuration.

On the private network shown in the right figure, multiple consecutive ports of a server need to be open to users on the public network. The private IP address of the server is 192.168.2.2/24, its server port is in the range of 2000-4000 or 5000, and its public IP address is 202.1.22.3/24. The interconnected IP address on the carrier network is 202.1.22.10. The private IP address and ports 2000-4000 and 5000 of the internal server need to be mapped to public IP address 202.1.22.3 and corresponding ports.

Procedure

  1. Set the IP address for the interface.

    <Huawei> system view
    [Huawei] sysname Router
    [Router] vlan 100
    [Router-vlan100] quit
    [Router] interface vlanif 100
    [Router-Vlanif100] ip address 192.168.2.1 24
    [Router-Vlanif100] quit
    [Router] interface ethernet 2/0/0
    [Router-Ethernet2/0/0] port link-type access 
    [Router-Ethernet2/0/0] port default vlan 100
    [Router-Ethernet2/0/0] quit 
    [Router] interface GigabitEthernet 1/0/0
    [Router-GigabitEthernet1/0/0] ip address 202.1.22.4 24
    [Router-GigabitEthernet1/0/0] quit 
  2. Create an ACL that matches the port numbers to be mapped.

    [Router] acl number 3001
    [Router-acl-adv-3001] rule 5 permit tcp destination-port range 2000 4000
    [Router-acl-adv-3001] rule 5 permit tcp destination-port eq 5000
    [Router-acl-adv-3001] quit
    
  3. Configure NAT server and reference the ACL.

    [Router] interface gigabitethernet 1/0/0
    [Router-GigabitEthernet1/0/0] nat server global 202.1.22.3 inside 192.168.2.2 acl 3001
    [Router-GigabitEthernet1/0/0] quit 
  4. Configure a default route on the router, with 202.1.22.10 as the next-hop address.

    [Router] ip route-static 0.0.0.0 0.0.0.0 202.1.22.10
    

More information

. Referencing an ACL to batch configure port mapping completes the mapping of consecutive port numbers and reduces the configuration workload. You do not need to run the nat server command on interfaces one by one. Additionally, to change the range of port numbers, you only need to change the ACL rules for future maintenance. One public IP address can be used for batch port mapping configuration only once. If other internal servers need to provide services for public network users, use other public IP addresses for port mapping configuration.


Can the Portal configuration on WLAN-ESS interfaces be modified in batches on the AC
No. ACs and Fat APs do not support this function.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top