open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: The crossover LAN

ITworld 12/18/2007

Sandra Henry-Stocker, ITworld.com

You have probably heard that a two-node LAN can be configured by stringing a crossover cable between the network ports on two systems. Not only is this true, but it's not all that hard to do provided you have a few tools, a length of CAT 5 cable and a couple RJ45 connectors. Using a crossover cable has one decided advantage over a traditional network hookup -- it avoids the requirement that a hub be used to connect the two systems, saving both money and rack space. So, let's examine what is needed to create your own crossover cable.

On this topic

First, you need a length of cat 5 or better cable. This generally gray cable contains four twisted copper wire pairs. The wire pairs are colored orange/orange and white, green/green and white, blue/blue and white and brown/brown and white. The frequency of the wire's twisting is critical to its resistance to electrical noise and crosstalk (signals leaking between the wires), so it's important that you straighten the wires as little as possible while working with it.

Next, you need a way to cut and strip the covering off the cable. There are special wire strippers that make this job easier, but you can manage with a pair of scissors if that's all you have on hand. Just be very careful to lightly bite the cable with the scissors and then turn them around by the handle until they have cut into the outer covering of cable just enough that you can pull it off. You want to end up with about a half inch of exposed wires, but start with more. You will trim the wires later in the process. Be very careful not to nick the covering of the wire pairs.

The third part is the more tedious. You need to rearrange the wires so that you end up with all eight wires lying flat beside in other in a particular order. On one end of the cable, fan the wires out in this order:

  1 green & white
  2 green
  3 orange & white
  4 blue
  5 blue & white
  6 orange
  7 brown & white
  8 brown

Then, grab the wires and try to line them up close to each other in the same order. I have found that moving my hands in a small "bicycle pedal" fashion seems to coax them out of their original orientation. After that, straighten and align the wires. Once they are reasonably cooperative, cut the ends off straight, leaving only half an inch of the previously twisted wires exposed. Be careful not to overdo the straightening of the wires in this process. Straighten only the exposed portion and don't tug too hard or you might straighten some length of the wires inside the cable covering as well.

Next, carefully glide the lined up wires into the RJ45 sleeve, holding the flat side of the cable toward you. You might have to tease the edge of the outer cover into the sleeve, but the wires should slide into their respective positions within the jack without too much objection.

No part of the individual wires should be exposed outside of the jack.

Then, gently slide the RJ45 jack into the appropriately shaped hole in your crimpers and squeeze. I have to squeeze very hard before my crimpers will open again and allow me to extract the completed connector but my crimpers were adopted from someone's trash pile so yours might work more easily.

Once that is done, do the same thing for the other end of the cable -- starting with stripping the out wire, fanning out the wires and so forth. When you are ready to align the wires, use the order listed in the "End 2" column below. This different wire arrangement is what makes the cable a crossover cable. Notice how we are switching the position of the 1-3 and 2-6 pairs:

  End 1 End 2
  ===== =====
  1 green & white 1 orange & white
  2 green 2 orange
  3 orange & white 3 green & white
  4 blue 4 blue
  5 blue & white 5 blue & white
  6 orange 6 green
  7 brown & white 7 brown & white
  8 brown 8 brown

When you're done with this, you have a crossover cable.

To connect two systems together, simply plug your new crossover cable into an available network adaptor on each of the systems and then issue some ifconfig commands to set up your network interface. In the commands below, I am connecting a Solaris system and a Linux box.

On the first (Solaris) system:

  # ifconfig hme1 plumb
  # ifconfig hme1 inet 192.168.11.10
  # ifconfig hme1 up

On the second (Linux) system:

  # ifconfig eth1 plumb
  # ifconfig eth1 inet 192.168.11.11
  # ifconfig eth1 up

At this point, you should see something like this in the ifconfig output on the first system and similar output (different IP address on the other).

  hme1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 
  3
  inet 192.168.11.10 netmask ffffff00 broadcast 192.168.11.255
  ether 0:3:ba:4:be:11

You should also see a new route in your routing table on each end of the connection:

  # netstat -rn
  Routing Table: IPv4
  Destination Gateway Flags Ref Use Interface
  -------------------- -------------------- ----- ----- ------ ---------
  192.168.11.0 192.168.11.10 U 1 1 hme1

On the second system, your ifconfig output will look something like this:

  eth1 Link encap:Ethernet HWaddr 00:02:B3:CF:11:38
  inet addr:192.168.11.11 Bcast:192.168.11.255 Mask:255.255.255.0
  inet6 addr: fe80::202:beff:feff:1138/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000
  RX bytes:0 (0.0 b) TX bytes:6238 (6.0 KiB)

Your routing tables should show any entry more or less like this:

  # netstat -rn
  Kernel IP routing table
  Destination Gateway Genmask Flags MSS Window irtt Iface
  192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

You can test your new network connection using ping or by logging in on each system from the other.

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
TRY NEW SUN SERVERS FREE for 60 Days!
Test The Latest Sun Servers In Your Environment BEFORE YOU BUY. Pay Nothing, Not Even Shipping.
Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.
Sign up for a FREE NETWORK RISK ASSESSMENT!
MORE THAN 70% OF NETWORKS ARE INFECTED by hidden Malware. Find out if your network is infected now!
Enterprise IP Goes Mobile
To maximize full productivity, companies must integrate their mobile applications with the IP network.
» Buy a link now

Advertisements
Sponsored links
Top 5 Reasons to Combine App Performance and Security
Locate Hidden Software on business PCs with this free tool
KODAK i1400 Series Scanners stand up to the challenge
Bring harmony to your mix of UNIX-Linux-Windows computing environments
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.