as a lab assignment we are supposed to configure our linux pc with two network interfaces and make it behave as a router. could you give me some guidance on how to proceed?

link|improve this question

43% accept rate
2  
Just toss in a Vyatta live CD :) – Tim Post Oct 5 '09 at 15:20
feedback

migrated from stackoverflow.com Oct 5 '09 at 15:08

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted

This will enable routing temporarily:

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

If your want this option to survive a reboot, add net.ipv4.ip_forward=1 to your /etc/sysctl.conf

HTH,
PEra

link|improve this answer
2  
You'll also want each interface configured in different subnets – Charles Hooper Oct 5 '09 at 15:30
If you do that, what exactly is the effect? An example? – djangofan Oct 5 '09 at 19:17
Example? Use the IP of that box as gateway to the subnet on the other side of the router an it will forward your packets... – PEra Oct 5 '09 at 19:47
where do you configure the forward address? – djangofan Apr 9 '10 at 23:17
feedback

If it is just a simple packet forwarding, do what PEra suggested. Try looking up shorewall for a quick and easy way to configure more things. For more advanced information, refer to LARTC instead.

link|improve this answer
+1 for shorewall, though it does involve a bit of a learning curve, however the curve is MUCH less than diving straight into iptables. – Tim Post Oct 5 '09 at 15:19
feedback

There is a large, detailed How-To here. There is another good one here.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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