連網技術與網絡管理 作業4

What's Gig0/0.1 and Gig0/0.2? I can only find Gig0/0,Gig0/1 and Gig0/3

Gig0/0.1 and Gig0/0.2 are subinterfaces of the GigabitEthernet0/0 interface. These subinterfaces are created using a feature called "802.1Q VLAN trunking" or "router-on-a-stick" configuration.

In this configuration, a single physical interface (in this case, GigabitEthernet0/0) is divided into multiple logical interfaces, each representing a different VLAN. The subinterfaces are identified using a dot notation, where the number after the dot represents the VLAN ID.

For example, in the configuration you mentioned, Gig0/0.1 and Gig0/0.2 represent two different VLANs. The ".1" and ".2" indicate VLAN IDs assigned to those subinterfaces. The actual VLAN configuration for these subinterfaces is typically done in the router's configuration.

By using VLAN subinterfaces, a router can handle traffic from multiple VLANs on a single physical interface. Each subinterface is associated with a specific VLAN and can have its own IP address and configuration, allowing the router to route traffic between different VLANs.

It's worth noting that the availability of subinterfaces and the specific naming convention may vary depending on the router platform and software version. It's always recommended to refer to the router's documentation or consult the manufacturer's resources for accurate and detailed information on subinterface configuration and support.

How can I create such sub interfaces?

To create subinterfaces on a Cisco router, you can follow these steps:

  1. Access the router's configuration mode: Enter privileged EXEC mode by typing enable and providing the appropriate password if required. Then enter global configuration mode by typing configure terminal or simply conf t.

  2. Navigate to the physical interface: Identify the physical interface you want to create subinterfaces for. In your case, it is GigabitEthernet0/0. Use the following command to access the interface configuration:

    kotlin
  3. interface GigabitEthernet0/0
  4. Create the subinterfaces: To create a subinterface, use the following command:

    csharp
  5. interface GigabitEthernet0/0.<vlan-id>

    Replace <vlan-id> with the desired VLAN ID for the subinterface. Repeat this command for each subinterface you want to create.

  6. Configure the subinterface: Once you are in the subinterface configuration mode, you can configure various parameters such as IP address, VLAN encapsulation, and access control lists (ACLs). For example, to configure an IP address for the subinterface, use the following command:

    css
  1. ip address <ip-address> <subnet-mask>

    Replace <ip-address> with the desired IP address and <subnet-mask> with the appropriate subnet mask for the subinterface.

  2. Repeat steps 3 and 4 for each subinterface: If you want to create multiple subinterfaces, repeat steps 3 and 4 for each subinterface, configuring the desired parameters as needed.

  3. Exit configuration mode and save changes: Once you have finished configuring the subinterfaces, exit configuration mode by typing end or exit. Save the configuration changes by typing write or copy running-config startup-config.

Please note that the exact commands and syntax may vary depending on the router model and software version you are using. It's always recommended to refer to the router's documentation or consult the manufacturer's resources for specific instructions related to your device.

en

conf t

int gig0/0

int gig0/0.1

ip address 192.168.2.1 255.255.255.0

 創建的子接口,在連線的時候不會顯示出來

The subinterface configuration, such as Gig0/0.1 or Gig0/0.2, may not be visible in the switch configuration interface because switches typically operate at Layer 2 and do not support subinterfaces directly. Subinterfaces are a concept specific to routers, where they allow for logical segmentation of a single physical interface into multiple virtual interfaces.

In a typical scenario, when connecting a switch to a router, you would use a regular physical interface on the router, such as Gig0/0, to connect to one of the switch ports. The switch port would be configured as an access or trunk port, depending on your network requirements. The VLANs and traffic segregation would be handled at the router level using the subinterfaces.

So, from the perspective of the switch, you will only see the physical interfaces of the router, and the configuration of subinterfaces will be done on the router itself. The switch will handle the traffic based on the VLANs and configurations provided by the router through the connected physical interface.

Therefore, it's expected that you won't see the subinterface options (such as Gig0/0.1 or Gig0/0.2) on the switch configuration interface. The subinterface configuration is specific to the router and is not directly visible or configurable on the switch.

 

給子接口綁定ip的時候提示

Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.

The error message you received suggests that configuring IP routing on a LAN subinterface is only permitted if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL VLAN. This means that you need to first configure the subinterface with VLAN encapsulation before you can enable IP routing on it.

To resolve this issue, you can follow these steps:

  1. Configure the VLAN encapsulation: Access the main interface configuration mode (e.g., GigabitEthernet0/0) and specify the VLAN encapsulation for the subinterface. Use one of the following commands depending on the type of VLAN encapsulation you want to use:

    For IEEE 802.1Q encapsulation:

    perl
encapsulation dot1q <vlan-id>

For ISL VLAN encapsulation:

php
  • encapsulation isl <vlan-id>

    Replace <vlan-id> with the desired VLAN ID for the subinterface.

  • Create the subinterface: After configuring the VLAN encapsulation, you can create the subinterface using the following command:

    csharp
  • interface GigabitEthernet0/0.<vlan-id>

    Again, replace <vlan-id> with the VLAN ID you specified in the encapsulation command.

  • Configure IP routing: Once the subinterface is created and associated with the VLAN encapsulation, you can configure IP routing on the subinterface. Use the following command to assign an IP address to the subinterface:

    css
  1. ip address <ip-address> <subnet-mask>

    Replace <ip-address> with the desired IP address for the subinterface, and <subnet-mask> with the appropriate subnet mask.

Remember to save your configuration changes after completing the configuration. If you still encounter any issues or limitations, it's recommended to consult the documentation or support resources specific to your router model and software version.

 

 switchport trunk allowed vlan all

 

interface GigabitEthernet0/1.1  進入子接口

encapsulation dot1q 10 然後設置vlan10

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章