I have a "server" with eth1 having a full IP address, DNS, gateway and proxy name connected to the university internet/intranet provider and eth0 IP connected by a gigabit switch with two "nodes" and All three running the latest full Debian Wheeze installation from DVD with all components available.

I have configured this subnet using "interfaces" file using only static IP addresses and netmask like this

iface eth0 inet static

with extra set of parameters for eth1 on "server" which is able to access internet through this card.

I can not arrange an internet access for the "nodes" through "server's" eth1 using iptables or any other tools available for look up on the Internet. Any help with complete script example using iptables and/or additional features/lines to introduce to the interfaces files on two "nodes" taking into account all these proxy and fixed university ipadress configurations for the outer network on eth1? SSH is working just fine on this subnet. My "server" can access Internet as well.

I'm reading this tutorial.

May be I misconfigured all these DHCP, NSF, NAT etc though I've never touched them directly and SSH is working just fine across this subnet.


Assuming that what you're looking for is to provide internal hosts to access the internet via your server:

First you need to set this box as the default gateway for the nodes.

Second you need to enable IP forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Third you need to masquerade (SNAT) the outgoing traffic from these hosts:

iptables -I POSTROUTING -o eth1 -j MASQUERADE

This should be all that you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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