A multihomed PC is one that has more than one network card in it. Well, the cards can be connected externally as well. Because the operating system, this case Windows XP, has more ways to reach out to the network with this multitudes of NICs, the choices for some fancy networking setup is possible. In this tutorial, I will keep things simple.
Let’s say you have two computers PC1 and PC2 with each computer has a network card in it. Both PCs can connect to the Internet at the same time courtesy of a router with an integrated switch that they are connected to. Through this router/switch, these two computers can also share files. Ok, so let’s say I want to keep the connection that is for sharing files and the connection that is sharing the Internet separate. This can be done by adding a second NIC to each PC. The following is the layout of the physical network.
INTERNET NIC1 ---- (switch/router) ---- NIC1 PC2 PC1 NIC2 --- (crossover cable) --- NIC2
As you can see, the NIC2 on both PCs are connected with a CAT5 crossover network cable. This is the connection that is used to transfer non-Internet data.
Now the hard part: assign the appropriate IP addresses to the various NICs.
Now the hard part: assign the appropriate IP addresses to the various NICs.
INTERNET NIC1 ---- (switch/router) ---- NIC1 PC2 PC1 NIC2 --- (crossover cable) --- NIC2
PC1NIC1: gets its IP from DHCP server
PC2NIC1: gets its IP from DHCP server. The IP range is 192.168.1.2 – 50
PC1NIC2: 192.168.2.1 Subnetmask: 255.255.255.254
PC2NIC2: 192.168.2.2 Subnetmask: 255.255.255.254
PC2NIC1: gets its IP from DHCP server. The IP range is 192.168.1.2 – 50
PC1NIC2: 192.168.2.1 Subnetmask: 255.255.255.254
PC2NIC2: 192.168.2.2 Subnetmask: 255.255.255.254
Now the secret. We need to create a static route in the routing table that would connect the two NIC2 together. This way, this “crossover” path has higher priority when time to communicate with each other. Noticed that I do not include the gateway and DNS IP for NIC2. This info is not necessary in this case for inter-PC data transfer. It is needed however for the Internet access.
The static route command is as followed.
On PC1:
route add -p 192.168.2.2 mask 255.255.255.255 192.168.2.1
route add -p 192.168.2.2 mask 255.255.255.255 192.168.2.1
On PC2:
route add -p 192.168.2.1 mask 255.255.255.255 192.168.2.2
route add -p 192.168.2.1 mask 255.255.255.255 192.168.2.2
The -p switch is just to tell Windows to remember the setting after restart.
So is this just an academic exercise or does it have practical use? Well, imagine instead of having just 2 PCs in this network, we have 10. All are connected to the switch/router and use the Internet extensively. However, of these 10 PCs, only PC1 and PC2 share lots of data. If this pair does not have its own “private” network, then their data sharing will flood the switch and slow down the Internet for everyone else.
No comments:
Post a Comment