Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to share my internet connectivity on eth0 with another computer on eth1.

+-----------+             +-----------+             +-----------+ 
|           |             |           |             |           | 
|ADSL Router|-------------| Computer  |-------------|NFS Client | 
|           |         eth0|           |eth1         |           | 
|           |         dhcp|           |static       |           | 
+-----------+             +-----------+             +-----------+

How can i maintain this network topology and allow internet connectivity with dns across my main computer?

share|improve this question
    
You can use Internet Connection Sharing, have a look at an answer I posted before: superuser.com/questions/274622/… –  Sandeep Bansal Apr 25 '11 at 13:24
2  
@Sandeep Bansal - ICS is for a windows machine and eth0, NFS and linux tag are indicating OP is running linux. –  laurent Apr 25 '11 at 17:46
    
Sorry misread the question –  Sandeep Bansal Apr 25 '11 at 18:06

3 Answers 3

You have to configure your Computer as NAT.
That's not trivial to explain here, please take a look to these links.

share|improve this answer

You can run a NAT/Firewall software like Firestarter on your computer.

Another solution without running anything is to do the NAT manually with iptables on NAT Table postrouting using Masquerade on your output external interface (eth0). See rule below:

-A POSTROUTING -o eth0 -j MASQUERADE 

and you will need to enable ip forwarding with:

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

and you will need to config a DHCP server (which is not hard in your case) but firestarter would do everything with a wizard.

share|improve this answer

I posted just such an answer at ServerFault.

share|improve this answer

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.