secondary IP addressing vs. 802.1q (or ISL) trunking
smcclenaghan
Member Posts: 139
in CCNA & CCENT
I feel like I should know this, or be able to grasp it, but I just can't.
Secondary IP addressing, as I understand it, is configuring multiple gateways on a single physical interface. So basically this:
interface fa0/0
ip address 192.168.1.1 255.255.255.0 secondary
ip address 172.16.0.1 255.255.0.0
Next, configuring 802.1q trunking on a router. As I understand it, this means allowing multiple VLANS on a single router, and trunking them to a connected switch. And it requires subinterfaces. Basically this:
interface fa0/0.1
ip address 10.0.1.1 255.255.255.0
encapsulation dot1q
interface fa0/0.2
ip address 10.0.2.1 255.255.255.0
encapsulation dot1q 2
interface fa0/0.3
ip address 10.0.3.1 255.255.255.0
encapsulation dot1q 3
(etc...)
Ok great. So my question is, when would you (ever) use secondary IP addressing instead of 802.1q trunking (via sub-interfaces)?
I guess I've been going about my studies with the impression that you always have one VLAN per subnet, and maybe you don't have to? Maybe you could have two subnets without any VLANs on the same router (and connected switch) and then they are just all in the same broadcast domain?
I sure would appreciate some guidance here.
Secondary IP addressing, as I understand it, is configuring multiple gateways on a single physical interface. So basically this:
interface fa0/0
ip address 192.168.1.1 255.255.255.0 secondary
ip address 172.16.0.1 255.255.0.0
Next, configuring 802.1q trunking on a router. As I understand it, this means allowing multiple VLANS on a single router, and trunking them to a connected switch. And it requires subinterfaces. Basically this:
interface fa0/0.1
ip address 10.0.1.1 255.255.255.0
encapsulation dot1q
interface fa0/0.2
ip address 10.0.2.1 255.255.255.0
encapsulation dot1q 2
interface fa0/0.3
ip address 10.0.3.1 255.255.255.0
encapsulation dot1q 3
(etc...)
Ok great. So my question is, when would you (ever) use secondary IP addressing instead of 802.1q trunking (via sub-interfaces)?
I guess I've been going about my studies with the impression that you always have one VLAN per subnet, and maybe you don't have to? Maybe you could have two subnets without any VLANs on the same router (and connected switch) and then they are just all in the same broadcast domain?
I sure would appreciate some guidance here.
Comments
-
Dieg0M Member Posts: 861The only reason I've seen secondary IP address used is in the expansion or migration of a production router. Let's say you outgrow your current subnet and need to bind another subnet to the same interface without taking the interface down to add sub-interfaces, then you would use the secondary IP address command. It's not best practice because you will share the same broadcast domain but it is a quick fix for the problem.Follow my CCDE journey at www.routingnull0.com
-
bulkos Member Posts: 11 ■□□□□□□□□□when you take it from the route perspective
- if you create sub intefaces they are treated in routing table as they were physical interfaces,it means that each subnet(vlan) will be accessible via different sub interface(each sub interface has its own mac address).
- when using secondary address two different directly connected subnets are accessible via same interface. -
smcclenaghan Member Posts: 139Thanks, Dieg0M. I wasn't sure if I grasped it, but it sounds like you're saying the same thing (that they would share the same broadcast domain, and that's the main difference).
-
smcclenaghan Member Posts: 139Thanks for the comment, bulkos.
I think the MACs would be the same though, right? I'll test this tomorrow and see. (Have to get up early in the am or I'd do it right now). -
bulkos Member Posts: 11 ■□□□□□□□□□yes you are right MAC is the same for both.
GigabitEthernet0/0.60 is up, line protocol is up (connected)
Hardware is PQUICC_FEC, address is 0009.7c85.3e01 (bia 0009.7c85.3e01)
Internet address is 10.10.60.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 60
ARP type: ARPA, ARP Timeout 04:00:00,
Last clearing of "show interface" counters never
BR#
BR#
BR#sh int gig0/0.70
GigabitEthernet0/0.70 is up, line protocol is up (connected)
Hardware is PQUICC_FEC, address is 0009.7c85.3e01 (bia 0009.7c85.3e01)
Internet address is 10.10.70.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 70
ARP type: ARPA, ARP Timeout 04:00:00,
Last clearing of "show interface" counters never