Use my PC to split an internet connection

2

There is only 1 Ethernet plug at my workstation, but I have 2 machines (desktop and notebook) My work desktop machine has 2 Ethernet ports.

Is there a way that I can have my desktop act as a router and have it supply my notebook with internet? I've drawn a diagram to explain what I'd like to accomplish.

I'm using MS Windows 7 Enterprise 64bit.

Thanks


enter image description here

Frantumn

Posted 2013-02-11T15:57:44.680

Reputation: 796

1

For the price of a burger meal you could buy a four port ethernet switch which would expand that single wall-socket to four sockets.

– RedGrittyBrick – 2013-02-11T16:04:07.093

So true. Downsite of that is that when IT finds out they will be angry with you for introducing new hardware into the network. – Hennes – 2013-02-11T16:10:43.957

Thanks @RedGrittyBrick but I can't for the exact reason Hennes said. – Frantumn – 2013-02-11T16:19:11.073

The right way to do this depends on information you haven't given us and likely don't know. You have to consult with the folks who manage the network. – David Schwartz – 2013-02-11T16:23:38.137

Updated my answer taking into account your comments. Please try to formulate your question with more information in the future, so that we don't have to extract information out of you with pliars/dental implements. – allquixotic – 2013-02-11T16:46:05.520

@Frantumn: Sorry - I overlooked that this was a corporate setting. For the price of a small automobile, your IT department can install another outlet (or a small switch) for you, your boss may need to authorise a requisition or something. – RedGrittyBrick – 2013-02-11T21:01:44.323

No Prob. I think allquixotic might be on the path I want. – Frantumn – 2013-02-11T21:12:46.930

Answers

4

Yes; you can use your computer to do this in one of two ways:

  1. Make it a Layer 2 switch. Very briefly, this involves "bridging" your "eth0" and "eth1" adapters so that they are both on the same ethernet network. This means that your "eth2" box would need its own IP address on the upstream network and would also send its own unique MAC address to the gateway. The network admins at work would know that you're doing this (quite easily) even without administrative access to your desktop PC.

  2. Make it a Layer 3 switch/router (set up IP masquerading). Very briefly, this involves setting up your computer to act similar to the way a normal router acts, which means you create a Network Address Translation (NAT) subnet, also known as IPv4 Masquerading, which means that you "forward" packets sent from eth2 to your computer (and the opposite way) up through the gateway NIC. This means that your "eth2" box would NOT need its own IP address on the upstream network and would NOT send its own unique MAC address to the gateway. Without administrative access to your desktop PC, the network admins would not be able to very easily tell that you're doing this, without examining traffic at the application layer.

Update

Judging from the comments, it seems like I can help you make some decisions:

  1. You're on Windows, so there are existing SuperUser questions about how to do this on Windows (either one of my above choices).

  2. You don't want to alert the IT guys, so you probably need to go with a Layer 3 switch/router on the computer. If you have administrative access, you can set up Internet Connection Sharing. For that, I defer to RedGrittyBrick's answer: Go here. Or there are likely to be hundreds of SuperUser questions about this.

Come to think of it, now that your question just boils down to "use ICS", this is a duplicate question, I'm sure of it. Just need to find the right question for the close vote.

allquixotic

Posted 2013-02-11T15:57:44.680

Reputation: 32 256

+1 for the "The network admins at work would know that you're doing this". @OP: also, they should be asked before you do this. – Hennes – 2013-02-11T16:16:28.413

Could the same be done if I used a wireless USB adapter? Could I set it up so that the wireless adapter pumped a signal out rather than took one in? – Frantumn – 2013-02-15T15:18:08.413

Yes, but a wifi adapter designed for consumers is not very likely to support infrastructure mode well (or at all) since it is not a common use case. Additionally, wifi is easy to detect using a device on a keychain that beeps when it detects a strong wifi signal. Most IT guys have one of these with them at all times. – allquixotic – 2013-02-15T16:30:11.923

1

RedGrittyBrick

Posted 2013-02-11T15:57:44.680

Reputation: 70 632

1

Yes, there is a way. But how to do that precise depends on the OS used.

Also note that when the desktop is off you will have plug the laptop into the cubicles Ethernet jack. When you want to use both again you will have to reverse that again. So it is probably a lot more practical to get either a cheap hub, or to ask IT for a second Ethernet Jack.

Having set that: If you do not care about being behind a NAT:

  • Windows: Internetsharing
  • Linux. Load ipmasq and set up the right routes and enable forwarding with echo 1>/proc/sys/net/ipv4/ip_forward.

If you do not want a second separate network for the laptop but have it appear on the normal network then you either need to ask IT for a fixed IP to use, or forward the DHCP requests from the laptop.

Hennes

Posted 2013-02-11T15:57:44.680

Reputation: 60 739