Imagine I have the following:
Switch1 (all ports on Vlan1)
fa0/10 ---connected to-----fa0/10Switch2
Switch2 (all ports on Vlan2)
If I want hosts from Vlan2 to communicate with switch1 Vlan1 hosts, I would need to do:
switchport mode trunk
switchport allowed vlan 2
and do the same on switch2.
Is that correct?
That's correct, but you'd need to create a vlan 2 on the vlan 1 switch and vice versa. The vlan's need to match on both switches. Then configure your int fa0/10 like your example.
You *may* need to change your line to allow vlan 1 also (but it's native by default, so you may not):
switchport allowed vlan add 1,2