Connecting two computers without a hub/switch/router?
I have two computers, each with a NIC. One is running Fedora Core 1, the other Windows 98.
Is there any way to connect them without a hub/switch/router in the middle? I don't have a crossover cable, so is it possible to do it with just a "normal" ethernet cable? And if it is, how would I set it up so that the internet on the FC computer can be accessed by the Windows computer? I know i'd have to do IP masquerading, but I don't remember the iptables commands and everyone seems to say a different things. The NIC on the FC computer is eth0, and it gets the internet from wlan0. Thanks! |
You can't with a straight eth cable. If the NICs have a BNC connector (extinct on newer NICs), you could connect them in a physical "bus" topo using coax cables. I would just spare the couple of bucks to get a x-cable and get it over with.
For masqurading, you need a similar rule in your firewall... iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE and enable packet forwarding (use sysctl or write to proc/sys/net). On the win98 side, set the gateway's IP to the FC box's IP. |
Re: Connecting two computers without a hub/switch/router?
Quote:
|
Thanks, if I had a crossover cable would it act like there was a switch between the two NICs? In other words, it would act like a normal network, right?
|
Oh, almost forgot.
So I just turn on IP forward, and add this rule to iptables: iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE ? What is the command to forward a port from this computer to the other one? Just assume this computer is 2.2.2.2 and the other one is 3.3.3.3, and the port being forwarded is 111, so it doesn't get confusing. And is that everything to set up NATing? I remember it being more complicated the last time I did it, but maybe I made it harder than I needed to. |
Quote:
A switch is a smart hub where it can direct traffic between ports. A hub will just pass traffic received to all ports. FYI Ethernet cable contains 8 wires 4 pairs of twisted wires. Only 2 pairs are actually used, 1 pair for transmitting and 1 pair for receiving. Network cards have a receiver and a transmitter. If you connect the straight cable between the two computers then the transmiters will be connected together as well as the receivers to receivers. In order for the PC #1 NIC transmitter to connect to PC#2 receiver and like wise PC #1 NIC receiver to connect to PC #2 transmitter you need to swap the wires at one end of the connecter. Hence the crossover cable. |
Quote:
To enable IP forwarding echo 1 > /proc/sys/net/ipv4/ip_foward echo 1 > /proc/sys/net/ipv4/ip_dynaddr |
I bought a crossover cable, and it works perfectly. Thanks everyone.
|
Can u help me
I want to know each step for establishing a Peer to Peer connection in two Laptops having Fedora 8. Can u plz help me
|
All times are GMT -5. The time now is 06:26 AM. |