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.

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?

share|improve this question

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

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

2  
Just toss in a Vyatta live CD :) –  Tim Post Oct 5 '09 at 15:20
add comment

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

share|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
add comment

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.

share|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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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