Here is my problem i have 2 Pcs, 1 is the host to internet the other is client connected by gateway so can anyone tell me if there is anyway i can host online on the client pc it looks something like this: [Client(pc2)]->[Host(pc1)]-[adsl] :rolleyes:

Dani AI

Generated

— it is doable without buying extra kit, but you need to forward the incoming traffic that reaches PC1 on to PC2 and make sure firewalls and the service on PC2 are reachable. , and already flagged the hardware/ISP angle; below are concrete, OS-specific ways to get traffic from the gateway machine (PC1) to the client (PC2), plus testing and safety notes.

On a Windows gateway (PC1) you can forward TCP ports to PC2 using netsh interface portproxy. Example (forward incoming HTTP on PC1 to PC2 at 192.168.0.2):

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=192.168.0.2 connectport=80
netsh advfirewall firewall add rule name="Proxy-HTTP" dir=in action=allow protocol=TCP localport=80

Give PC2 a fixed LAN IP and verify the server on PC2 is bound to the LAN address (or 0.0.0.0).

On a Linux gateway use DNAT + forwarding and enable IP forwarding:

sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.0.2:80
iptables -A FORWARD -p tcp -d 192.168.0.2 --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT

If you cannot receive unsolicited inbound connections (no public IP or ISP filtering), a reverse tunnel from PC2 to a public server can expose the service without changing the gateway:

ssh -R 8080:localhost:80 user@public-server

Quick checklist: set PC2 to a static LAN IP; confirm the server listens (netstat/ss); open the necessary firewall ports on PC1 and PC2; test locally first, then from an external IP; and harden the exposed service (patching, minimal permissions). These steps extend the practical points raised by , and with actionable commands and tests.

Recommended Answers

All 3 Replies

While your question is somewhat vague as to what you man by 'hosting' (website?)
I would just pick up a 4 port hub and then jack each machine into the hub
then out to the net.
|----------------LAN SIDE---------------------|----WAN SIDE|
[machine a] -> [eth0/nic] -> [4port hub] -> [DSLmodem] -> [net]
[machine b] -> [eth0/nic] ----^

as far as resources go..

Windows only.
if youre hosting a website from 'machine a' (gateway)
in your current configuration and want to share out hard drive resources or file
system(s) from machine b through it all they have to be is in the same
workgroup and each has to have a mappable shared drive. then you can map
a drive from b to a and then utilize the resources on 'machine b.'

linux is different, unix is as well. differing OSs can make this far more
complicated than this needs to be.

Also,

check the specs on the DSL modem. You may need to get a router instead of a hub.

I would just pick up a 4 port hub and then jack each machine into the hub
then out to the net....

Catnip is right:

When using a hub or switch (instead of a router) for that sort of configuration, you need to check with your Internet service provider first.

If the ISP only allocates 1 IP to your account, uses the MAC address of the connected computer as part of your account/connection validation, or uses any other methods which would disallow concurrent logons from multiple computers, a hub or switch won't do the trick. Many ISP do have limit like this, and the choices in that scenario are either to see if the ISP allows you to purchase additional IP addresses, or to use a router instead of a hub.

A) Broadband routers use NAT (Network Address Translation) to allow multiple computers to share a single connection (without your ISP knowing that you have more than one machine connected). Hubs cannot do this.

B) Broadband routers can be configured (via port-forwarding) to allow computers on the LAN (your internal network) to act as Web, FTP, game, etc. servers to the outside world, while still providing some measures of security for those machines. Hubs cannot do this either.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.