Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

TCP/IP, VLAN, and OSPF Configuration on Huawei eNSP

Tech 2

TCP/IP Protocol Suite

The TCP/IP protocol suite serves as the foundational communication language and standard for interoperability across diverse network architectures and operating systems.

Core Elements of Host Communication

1. IP Addressing An IP address uniquely identifies a node's network location. IPv4 utilizes a 32-bit address space, while IPv6 uses 128 bits. Structurally, an IP address combines network and host portions, represented in dotted decimal notation (e.g., 10.0.0.1).

IPv4 addresses are categorized into five classes based on their leading bits:

  • Class A: Starts with 0. Range: 1.0.0.1 - 126.255.255.254. Designed for massive-scale networks.
  • Class B: Starts with 10. Range: 128.0.0.1 - 191.255.255.254. Suited for medium-sized organizations.
  • Class C: Starts with 110. Range: 192.0.0.1 - 223.255.255.254. Allocated for smaller networks.
  • Class D: Starts with 1110. Range: 224.0.0.1 - 239.255.255.254. Reserved for multicast traffic.
  • Class E: Starts with 1111. Range: 240.0.0.1 - 255.255.255.254. Designated for experimental use.

The 127.0.0.0/8 block is reserved for loopback testing.

IP addresses are also split into public and private scopes. Public IPs are globally unique and routable on the internet. Private IPs are restricted to internal enterprise networks and are not routable globally. Private ranges include:

  • Class A: 10.0.0.0 - 10.255.255.255
  • Class B: 172.16.0.0 - 172.31.255.255
  • Class C: 192.168.0.0 - 192.168.255.255

2. Subnet Mask A subnet mask distinguishes the network portion from the host portion within an IP address. Network bit are masked with 1 (decimal 255), while host bits are masked with 0. For instance, 255.255.255.0 applied to 192.168.1.1 dictates that the first three octets represent the network.

3. Default Gateway The gateway acts as the exit point for data packets traveling from one network segmant to another.

Network Devices

Switches Switches interconnect multiple devices to form a local area network (LAN), providing dedicated communication paths. They are broadly classified into:

  • Unmanaged: Plug-and-play, no configuration capability.
  • Managed: Allow advanced configurations like VLANs, ACLs, and stacking.

Routers Routing is the process of forwarding packets between different networks. Routers connect distinct network segments and rely on routing tables to determine the best forwarding path. Upon receiving a packet, a router examines the destination IP, matches it against its routing table entries, and forwards it accordingly.

Routes are generated either directly (when an interface is configured with an IP and is physically up) or indirectly. Indirect routes include:

  • Static Routes: Manually configured by an administrator.
  • Dynamic Routes: Learned automatically via routing protocols.

Huawei eNSP Fundamentals

Command Views

  • User View: Indicated by <Huawei>
  • System View: Indicated by [Huawei]
  • Interface View: Indicated by [Huawei-GigabitEthernet0/0/1]
  • Protocol View: Indicated by [Huawei-ospf-1]

Essential CLI Commands

  • display version: Shows device software and hardware details.
  • display current-configuration: Outputs the active configuration.
  • display this: Displays the configuration for the current view.
  • system-view: Enters system view from user view (Ctrl+Z returns to user view).
  • sysname <name>: Modifies the device hostname.
  • undo <command>: Reverts or removes a specific configuration.
  • undo info-center enable: Disables informational logging to the console.
  • quit: Exits the current view level.
  • save: Writes the running configuration to non-volatile memory.
  • reboot: Restarts the device.
  • user-interface console 0: Enters console configuration mode.
    • authentication-mode password: Sets authentication to password-based.
    • set authentication password cipher <pass>: Defines an encrypted console password.
    • idle-timeout <minutes>: Configures the session timeout duration.
  • reset saved-configuration: Clears the saved configuration (factory reset sequence requires confirming, rebooting, skipping save, and confirming reboot).
  • undo terminal monitor: Suppresses terminal alert messages.

Interface and IP Commands

  • interface <port>: Enters a specific interface (e.g., int g0/0/1).
  • shutdown / undo shutdown: Disables or enables the interface.
  • display ip interface brief: Summarizes IP settings and interface statuses.
  • ip address <ip> <mask>: Assigns an IP address (e.g., ip ad 10.1.1.1 24).
  • display ip routing-table: Displays the IP routing table.
  • ip route-static <dest-net> <mask> <next-hop>: Creates a static route.

VLAN Configuration Commands

  • vlan <id>: Creates a single VLAN.
  • vlan batch <id1> <id2>: Creates multiple non-sequential VLANs.
  • vlan batch <id1> to <id2>: Creates a sequential range of VLANs.
  • display vlan: Verifies VLAN information.

Access Port Configuration

port link-type access
port default vlan 20

Trunk Port Configuration

port link-type trunk
port trunk allow-pass vlan 20 30

Hybrid Port Configuration Untagged (strips VLAN tag on egress):

port link-type hybrid
port hybrid untagged vlan 20
port hybrid pvid vlan 20

Tagged (preserves VLAN tag on egress):

port link-type hybrid
port hybrid tagged vlan 20 30

CLI Navigation Tips

The CLI is case-insensitive, supports Tab for auto-completion, allows command abbreviation, and provides context-sensitive help via the ? character.

Practical Implementations

Implementing Virtual LANs and SVI

To segment a network and enable Layer 3 routing between VLANs using Switch Virtual Interfaces (SVI):

[Huawei] vlan batch 10 20 30
[Huawei] interface GigabitEthernet0/0/5
[Huawei-GigabitEthernet0/0/5] port link-type access
[Huawei-GigabitEthernet0/0/5] port default vlan 10
[Huawei-GigabitEthernet0/0/5] interface Vlanif10
[Huawei-Vlanif10] ip address 10.1.10.1 24

Configuring an uplink trunk and its corresponding SVI for gateway functionality:

[Huawei] interface GigabitEthernet0/0/24
[Huawei-GigabitEthernet0/0/24] port link-type trunk
[Huawei-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20
[Huawei-GigabitEthernet0/0/24] interface Vlanif1
[Huawei-Vlanif1] ip address 10.1.1.1 24

Configuring Remote Management (Telnet)

By default, all physical ports belong to VLAN 1. Assigning an IP to Vlanif1 provides a management interface for the switch.

Server-side (Switch) configuration:

[Huawei] user-interface vty 0 4
[Huawei-ui-vty0-4] authentication-mode password
[Huawei-ui-vty0-4] set authentication password cipher MyS3cr3tK3y
[Huawei-ui-vty0-4] user privilege level 15

Client-side connection:

<Client> telnet 10.1.1.1

Telnet operates over TCP port 23.

Deploying OSPF Routing

Open Shortest Path First (OSPF) is a link-state routing protocol. Routers exchange link-state advertisements (LSAs) to build a complete topological map of the network, utilizing the SPF algorithm to compute the shortest loop-free paths. OSPF uses Hello packets (sent every 10 seconds on broadcast networks by default) to maintain neighbor adjacencies; a neighbor is declared down after four missed Hello intervals (40 seconds). Key benefits include rapid convergence, scalability for large networks, loop-free routing, and hierarchical design using areas.

Configuration example for a router in Area 0:

[R1] router id 10.10.10.1
[R1] ospf 100
[R1-ospf-100] area 0.0.0.0
[R1-ospf-100-area-0.0.0.0] network 172.16.1.0 0.0.0.255
[R1-ospf-100-area-0.0.0.0] network 172.16.2.0 0.0.0.255

The 0.0.0.255 wildcard mask dictates that the first three octets must match the network address exactly, while the last octet can be any value.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.