[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ethernet question



Alec wrote:

How does one connect two computers to the internet throught one ethernet socket? Does one of them have to have two ethernet cards and run special software?

Technically, one socket would not do the job. But to your querstion:

One computer acts as a gateway. One interface is connected with the internet (eg. ethernet adaptor for xDSL, modem, ISDN adaptor etc.). A second adapter is used to bridge the internal network/te second computer with the internet. The first one (gateway) therefore an ethernet card (will be the "second" one if using xDSL). You can use NAT (network address translation) to let the other computer send and receive data to/from the internet through the gateway. You do not need external/additional software to do this, just use iptables of the 2.4 kernel series.

The gateway will establish a connection like a single workstation while setting up an additional script in /etc/init.d/ will activate NAT ("ipforward" or "ipmasquerading") and additional firewall rules.

Thus, a gateway's client will send a request to the gateway. That repackages this request and sends it out in "his name" (IP). On receive, it knows from which client the request came and sends the results back.

Hope thi helped,

Timo



Reply to: