L2 and L3 Ip configuration difference?

lazaki222lazaki222 Registered Users Posts: 1 ■□□□□□□□□□
Hi,

I'm confused between this two configuration

interface TenGigabitEthernet3/1
switchport
switchport access vlan 999
switchport mode access
switchport nonegotiate
no ip address
logging event link-status
!
interface Vlan 999
ip address 10.193.1.141 255.255.255.252
no ip redirects
no ip proxy-arp
ip pim sparse-dense-mode
ip route-cache flow
logging event link-status
end

compare to this


interface TenGigabitEthernet3/1
no switchport
ip add 10.193.1.141 255.255.255.252
no ip redirects
no ip proxy-arp
ip pim sparse-dense-mode
ip route-cache flow

logging event link-status
!


Both have the same output but what is the difference why do still need to create SVI then assigned to physical interface?

Thanks

Comments

  • clarsonclarson Member Posts: 903 ■■■■□□□□□□
    Not really sure what your trying to describe. Because the output looks different to me.

    But, probably what your talking about is the difference between:
    for the top: switchport mode access
    and for the bottom: no switchport

    with the top: your assigning an ip to the svi
    on the bottom: you assigning an ip to the port. this port doesn't do switching and isn't a member of a vlan. probably meant to be used for performing routing.
  • daveybdaveyb Member Posts: 28 ■□□□□□□□□□
    It depends on what you are trying to do. The first config will allow you to put multiple ports in that vlan, so they can all have the same L3 interface for egress. The second config will only allow one port to use the L3 interface for egress, so would be used for a p2p or similar.

    It should be noted that behind the scenes, the second config acts as the first. A vlan is reserved and used by the switch to make this functionality occur.
  • HondabuffHondabuff Member Posts: 667 ■■■□□□□□□□
    lazaki222 wrote: »
    Hi,

    I'm confused between this two configuration

    interface TenGigabitEthernet3/1
    switchport
    switchport access vlan 999
    switchport mode access
    switchport nonegotiate
    no ip address
    logging event link-status
    !
    interface Vlan 999
    ip address 10.193.1.141 255.255.255.252
    no ip redirects
    no ip proxy-arp
    ip pim sparse-dense-mode
    ip route-cache flow
    logging event link-status
    end

    compare to this


    interface TenGigabitEthernet3/1
    no switchport
    ip add 10.193.1.141 255.255.255.252
    no ip redirects
    no ip proxy-arp
    ip pim sparse-dense-mode
    ip route-cache flow

    logging event link-status
    !


    Both have the same output but what is the difference why do still need to create SVI then assigned to physical interface?

    Thanks


    1st config you would use on a L3 switch to assign multiple ports to an SVI "access layer". 2nd Config you would assign to a L3 switch "port" and route back to your core "distribution layer".
    “The problem with quotes on the Internet is that you can’t always be sure of their authenticity.” ~Abraham Lincoln
  • ImYourOnlyDJImYourOnlyDJ Member Posts: 180
    The above posts pretty much covered it. In your example they would essentially do the same thing but in a different way. If you could provide what the context is that would be helpful.

    One reason you would use the first config would be if the ports you are using don't support layer three. Examples would be Etherswitch modules (addon layer 2 modules for when you don't need a dedicated switch), routers with built in switches (ie 800 series), or perhaps old chassis based switches that only have layer 2 ports/blades.

    Your first config is odd because you only have one more usable IP due to the /30 mask. So you would probably use this for transit, (device to device connection), segregation of one device, or as a management IP for the device. If the subnet was bigger than a /30 then this device would probably a default gateway for a subnet (ie the interface Vlan999 IP address could be 192.168.1.1 and serve as the gateway for the 192.168.1.0 subnet).
Sign In or Register to comment.