You can easily find nowadays Layer 3 switches, i.e., switches with routing capabilities. It works by creating virtual interfaces (vlan interfaces) with IP addresses. Just doing that you create entries on the switch routing table (yes, as I've said, it behaves as a router!) and the vlans will communicate with each other.
You can add static routes (as a default route pointing to your firewall, for example) or even enable a dynamic routing protocol (ospf, bgp...), depending on the hardware and firmware available resources. And your hosts and servers can use this switch as their default route.
Here is an example on a Cisco switch:
!
interface Vlan5
ip address 10.50.0.1 255.255.255.0
!
interface Vlan6
ip address 10.60.0.1 255.255.255.0
!
interface GigabitEthernet0/1
description Desktop station
switchport
switchport access vlan 5
switchport mode access
!
interface GigabitEthernet0/2
description Server
switchport
switchport access vlan 6
switchport mode access
!
ip route 0.0.0.0 0.0.0.0 10.60.0.254
!
switch1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is 10.60.0.254 to network 0.0.0.0
10.0.0.0/8 is variably subnetted, 2 subnets, 1 mask
C 10.50.0.0/24 is directly connected, Vlan5
C 10.60.0.0/24 is directly connected, Vlan6
In this example, the device connected on interface G0/1
will be able to communicate with the other one connected on the G0/2
, even though they are on different vlans (and that default route is not required).