A router would be a good idea. You can even build your own from an old pc and it too can run a Linux distro like Coyote Linux that even has an easy to use web based interface, has great support and is of course FREE!

Personally I use a Linksys WRT54G router (now owned by by Cisco) that runs a Linux kernel but I have built and used Linux routers and learned a great deal in the process.

It really isn't as simple as posting the right commands for you to execute. You're going to have to do some reading and learn aboout networking period.

One very good tool is nmap. Some brief examples:
Code:
nmap localhost
nmap 192.168.1.20
There are firewalls on Knoppix with easy to use interfaces as well. It really depends on your abilities, your ambition and your budget. You can probably bet on getting flamed anytime you ask such a broad question.

Had your post started with "I'm just learning Linux and trying to configure iptables and having a problem with......" You would do alot better. http://google.com/linux is your friend.

Edit
Oh yeah - it sucks when people double post!