2

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?

  • 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
1

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

1

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.

0

I posted just such an answer at ServerFault.

  • 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 '16 at 9:37

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.