Search code examples
natciscovlan

Configuration virtual Vlan instead of physical port


Currently i am studying for NAT and from what i read, vlans on physical port on switch actually not good for NAT.

I search for a couple of times but only sources that i got, configure the vlan on physical port like

interface gi0/1
switchport mode access
switchport access vlan 10

Instead of doing this, i want to do

interface vlan 10
ip add 10.1.12.254 255.255.254.0
ip nat inside
  1. What is the differences between interface gi0/1 and accessing vlan through that port, and interface vlan 10?

  2. I cannot make encapsulation dot1q through interface vlan 10, or it works only for physical ports?

  3. Let's say that i have two vlans, vlan 10 (WLAN) and vlan 99 (USERS). Vlan 10 has an IP address 10.1.12.0/23 and port is gi1/0/24. Vlan 99 has an IP address 10.1.14.0/24 and range is gi1/0/1-23. Do I need to configure them like,

    interface range gi1/0/1-23

    switchport mode access

    switchport access vlan 99

or are there any way for me to configure only interface vlan 99?

I know this is a basic configuration but two of them making me so confused.

Many thanks


Solution

  • One of the differences between interface VLAN and the physical interface is, you can add an IP address to an interface VLAN, but in L2 switch you can't add an IP address to a physical interface. We can say physical interface is a layer 2 interface and doesn't support layer 3 options like IP and Routing and etc.

    Network admins use Interface VLAN as a gateway for each VLAN. For example, if you want to use inter-VLAN routing, you can use interface VLAN as a gateway for all traffic in that VLAN.

    when you say

    int gig 0/0
    switchport mode access
    switchport access VLAN 2
    

    The switch itself tags the port to dot1q vlan 2. So you don't need to tell the switch anything. You just need to put the physical port in the vlan.