Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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
    
This is an ancient post, but please consider expanding your answer. It's better for answers to be self-contained rather than sending the reader off to check out an answer somewhere else. You can duplicate the answer here and leave the link for attribution, or include the essential points here and use the link for further reading. Thanks. – fixer1234 Jan 9 at 9:37

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.