Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In our departement we have a blade system with one master node and four slave nodes that are connected to the master node. The system uses its own subnet (192.168.1.x) and only the master node is connected to the intranet (and thereby to the internet). On every node runs CentOS 5. I would like to update CentOS (by using yum). How to update the slave nodes as they don't have direct access to the intranet/internet. Could you please lead me in the right direction how to setup a forwarding/routing so that the slave nodes can do requests to the intranet/internet, too?

More details about the setup:
- master node
eth1 161.42.9.9
eth0 192.168.1.254
gateway 161.42.9.1

- 4 slave nodes
Connected to master eth0
IPs 192.168.1.1-4 (fetched using DHCP running on master)
gateway 192.168.1.254

Only 161.42.9.9 (=master) is allowed to access the internet (by using a proxy).

share|improve this question

closed as not a real question by Chopper3, Ladadadada, voretaq7 Jul 26 '12 at 20:58

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
More information is needed about your network setup like default gateway of system nodes and IPs allowed to access Internet. –  Khaled May 8 '12 at 13:12
    
Sure ... I updated the question. –  Zardoz May 8 '12 at 13:32
    
You've added maybe 1% of info we'd need. –  Chopper3 May 8 '12 at 13:39

1 Answer 1

up vote 2 down vote accepted

If you want to provide Internet access using the same public IP address, you need to use iptables to do SNAT (source NAT):

iptables -o eth1 -A POSTROUTING -s 192.168.1.1 -j SNAT --to-source 161.42.9.9
iptables -o eth1 -A POSTROUTING -s 192.168.1.2 -j SNAT --to-source 161.42.9.9
iptables -o eth1 -A POSTROUTING -s 192.168.1.3 -j SNAT --to-source 161.42.9.9
iptables -o eth1 -A POSTROUTING -s 192.168.1.4 -j SNAT --to-source 161.42.9.9

You need also to enable IP forwarding on the master node. Run as root:

# echo 1 > /proc/sys/net/ipv4/ip_forward
share|improve this answer
    
Thanks a lot. That was the hint I was searching for. –  Zardoz May 8 '12 at 14:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.