Why do routers have only a few interfaces? Since one router interface is one subnet itself, a router given G0/0, G0/1 and G0/2 can only have three subnets.
Is it sustainable? How can we go beyond three subnets, or is this where VLAN plays a part?
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.Sign up to join this community
You forget that routers can have virtual interfaces. For example, you can create
GigbitEthernet0/0.10. You can have many, many different VLANs, each with its own network, on virtual interfaces of a single physical interface.
Routers only need to terminate the layer-2 LANs. It is the LANs that really need a lot of interfaces, so you use switches for the LAN interfaces, and the switch connects to the router (with a trunk if you have more than one VLAN).
This is 3 question in your post, so I'll try to answer the 3
1 - there is routers with loooooots of interfaces. most switches are layer 3 switches, which is a router. Lots of enterprise routers only use 2 or 3 ports just because most enterprise don't need more. In this case the router has an "outside" interface (connected to the Internet) and an "inside" interface, which is typically connected to a layer 2 switch.
2 - You can have multiple subnets on 1 interface with secondary ip address (in Cisco language)
Interface Ge0/0 ip address 184.108.40.206 255.255.255.0 ip address 220.127.116.11 255.255.255.0 secondary ip address 18.104.22.168 255.255.255.0 secondary
Note that if 22.214.171.124/24 want to communicate with 126.96.36.199/24 all trafic will go through the router. This has nothing to do with VLAN... It's just that 188.8.131.52/24 is outside of 184.108.40.206/24 so all trafic has to be send to the router/gateway (220.127.116.11)
3 - VLAN allow you to create virtual interface on the router using an identifier (the VLAN). Layer 2 trafic is impossible between 2 vlan (it's like 2 distinct network) but the router will be able to route trafic from 1 vlan to another
Interface Ge0/0.10 encapsulation dot1q 10 ip address 18.104.22.168 255.255.255.0 Interface Ge0/0.20 encapsulation dot1q 20 ip address 22.214.171.124 255.255.255.0
Of course, Vlan needs to be configured at the switch level.
Router is layer3 divices . With inter-Vlan routing for single interface more VLANs can be configured . For example below
Router(config)# int F0/0 Router(config)# no ip address Router(config)# no shutdown
Router(config)# int f0/0.10 Router(config)# ip address 192.168.1.0 255.255.255.0 Router(config)# no shutdown
Even with single Router interface which is L3 interface act gateways for all Vlans with inter-Vlan routing.
Router L3 interface can connect to layer2 switch and can build entire LAN networks.