How to configure centos 5.4 to work as a router and firewall on its own
Hi,can anyone pls guide me step by step on how to setup centos to act as router and firewall at our office i just installed the os now i dont know where to go from here i have all the isp adresses,dns and gateway any assistance will be greatly appreciated coz am really interested in learning linux thanxs
iused some instructions on this site http://wiki.centos.org/HowTos/Network/IPTables and when i try the /sysctl.config on my terminal now i get the message permission denied |
There's really very little to it. You turn it into a "router" by going into /etc/sysctl.conf and setting the parameter "net.ipv4.ip_forward = 1" and reboot (you can do it without rebooting, but let's not confuse things).
as for the firewall side, the standard firewall settings live in /etc/sysconfig/iptables. you can edit that file directly or use system-config-firewall To most people routing also implicitly means natting, so IF that's the case, then you'd need to enable ip masquerading for nat. The best way for you to achieve this is probably to add a few lines that say: Code:
iptables -A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -o eth0 -j MASQUERADE updating the subnets and interface appropriately. You can make this permanent by running "service iptables save" That's really the basics of it. You should be comfortable with what you're doing before it goes into service though, there are so many ways you could possibly be at risk if you don't know what you're doing. |
Great advice from acid_kewpie as always :)
I'd just add that you'll probably want to bookmark and read the Admin HOWTO Guide here http://www.linuxtopia.org/online_boo...ion/index.html |
thank you
Quote:
|
You definitely need to read that link I supplied. Also, this is a great tutorial http://rute.2038bug.com/index.html.gz
acid_kewpie said Code:
/etc/sysctl.conf Code:
/etc/sysctl/config Also, at this level you'll need to be the root (aka admin) user, not a normal user. |
well the very first thing is to upgrade to THE ONLY SUPPORTED version CentOS 5.6
5.4 will NEVER get updates hopefully you have let yum auto do this but???? if not Code:
su - |
All times are GMT -5. The time now is 08:56 AM. |