Hi
Are you saying it doesn't work or you don't know the commands. Config example in brief
int fa0/0.10
encapsulation dot1q 10 <- This must match the vlan number
ip address 192.168.5.1 255.255.255.0
int fa0/0.20
etc...
Oobviously the switchport that fa0/0 connects to needs to be configured as an 802.1q trunk.
If you do not have the enacapsulation option available under the subinterface bear in mind you need a minimum of IP Plus to run 802.1q.
HTH
Jon