I understand that every sub-interfaces needs ip address for inter-vlan to be working (being linked to switch)
And each ip address can be different.
Does the main interface ie fa0/0 or fa0/1 need ip address as I have seen some examples of them not having ip address
Can someone please clarify this.
And I assume the trunkport on the switch has to go to either one. I assume whichever connnects to the ISP or the default gateway.
Thanks in advance again.
The main interface can have an IP but if it does you must make the native vlan on the trunk link the vlan that is assigned to the main interface ie. it won't accept tagged traffic on the main interface.
Usually the setup is not to use the main interface.
The trunk link would usually be for your internal vlans, not the connection to the ISP.
I mostly agree with what Jon explains but would approach it slightly differently. When doing a connection for a dot1Q trunk there is one vlan, which is the native vlan, and this vlan sends frames untagged. When connecting to a router you have a choice about how to process frames for the native vlan. 1) you can configure an IP address on the main/physical interface and let it process frames for the native vlan. 2) you can configure a subinterface and set it for the native vlan. In 2) the main/physical interface has no IP address and the IP address for the vlan is configured on the subinterface.
I agree with Jon that 2) is more common than 1) but both are possible and either one works fine. I agree that trunking subinterfaces are more common on the connection to your internal network but I have seen trunking subinterfaces configured on the connection to the ISP, especially when dealing with Metro Ethernet.