For firewall:
http://www.google.co.uk/search?hl=en&q...earch&meta=use iptables to configure this. If the machine has two network cards, which it should do if you want to do this, you need to enable IP forwarding.
How are you wanting anti-virus to work? For web browsing? Squid and squidclam should be able to do this for you. If you want email scanning, then you'd have to set up a postfix server with amavisd and clamav installed to do content-filtering. Then you can then relay the emails from this gateway server to the real email server inside your network. If you don't have an email server inside your network, then you won't be able to do this.