So does the Centos server have just one ethernet card hooked up or multiple?
If it's just a single interface then something like this would work. Using those pictures as the prefix you'd like this on.
Add an ip alias (this is your loopback equivalent)
Code:
Temporary - ifconfig eth0:share 192.168.0.1 netmask 255.255.255.0
Permanent - for centos you'll need to go into /etc/sysconfig/network-scripts and copy ifcfg-eth0 to ifcfg-eth0:share and update the device and ip information in that file
Turn on ip forwarding:
Code:
Temporary - echo 1 > /proc/sys/net/ipv4/ip_forward or sysctl -w net.ipv4.ip_forward=1
Permanent - edit your sysctl file, typically /etc/sysctl.conf, look for the line that says net.ipv4.ip_forward, switch it from a 0 to a 1
Tell your computer to masquerade for the other hosts:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
192.168.0.0/24 is the cidr notation for the prefix containing the ip address assigned to the ip alias eth0:share
You'll want to save that iptables stuff with something like - /sbin/service iptables save
so that it'll be there after a reboot. I'd try it out first to make sure it's doing what you want before saving it.
Then just tell the other computers sharing it that the Centos server aliased ip address (192.168.0.1) is their default route, which will vary depending on what OSes they are.