Hello Ole, the SG300 by default is a layer 2 switch. The first thing to do, ensure you're running the 1.1.2.0 or 1.2.7.76 code. This means your router must support the vlans/interfaces and dot1q encapsulation for this to work. If you do not wish this outcome, you may use the switch for layer 3 functionality.
If you wish for the L3 functionality, log in to the CLI and use the command "set system mode router" then "reload". This will factory default reset the switch then after the reboot, the switch will be layer 3.
After you're finished loading, readd the vlans
config t
vlan database
vlan 2,3,4,5, etc
Next, assign an IP address to the vlan interface
config t
int vlan 1
ip address 192.168.1.254 /24
int vlan 2
ip address 192.168.2.254 /24
etc
After adding the IP addresses to the VLAN interface and there is an active link on the VLAN, the switch will dynamically build the directly connected routes. You may verify the routes with "show ip route"
-Tom
Please rate helpful posts
-Tom
Please mark answered for helpful posts
http://blogs.cisco.com/smallbusiness/