LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to setup a lan with CrossOver Cables (https://www.linuxquestions.org/questions/linux-networking-3/how-to-setup-a-lan-with-crossover-cables-168673/)

RHLinuxGUY 04-11-2004 12:12 AM

How to setup a lan with CrossOver Cables
 
Im trying to get 2 computers (both running RedHat 9) so me and my friend can play some counter-strike, so how do I go about doing this, I have 1 crossover cable, and I want one computer connected to the internet so my friend computer and I can share internet. Just to let u know I have almost no experience on seting up a network, so help me through please. Thanx in advance!

exodist 04-11-2004 01:34 AM

on each computer type this:

ifconfig eth0 192.168.0.1(2 for second computer) netmask 255.255.255.0

as long as your ethernet card is identified by the kernel it will be fine, this way though you type it every time you reboot, you can add it to a script or figure out redhatsnetworking system (I always make my own networking scripts and ditch the builtins for the systems I am on.)

microsmart 04-11-2004 02:34 AM

I am sorry, I have this problem two.2 of my computers have Fedora installed. One has wireless Lan connection with IP 192.168.0.2 and I have crossover cable to connect 2 computer, but I don't know how to setup.Can you help me?I cannot set 2 computer to 192.168.0.1 and 192.168.0.2,right?Do I have to set their IP: 127......??Please help me, I am just a newbie!
Thank you in advance!

exodist 04-11-2004 04:18 AM

the commands/ip's I gave you should be fine as long as the 2 computers connected to the crossover are the only computers connected to eachother, if the wireless connects one to the internet while it is connected to the other and it uses that ip address change my commands to be 192.168.1.1 and 192.168.1.2, if you want you can change the subnet mask to 255.255.0.0 if you want but it won't do much, or if you want a very different ip scheme to be ultra safe try 10.1.9.1 and 10.1.9.2 on the same subnet (255.255.255.0) (subnet is netmask if you were wondering)

microsmart 04-11-2004 06:24 AM

Thank you very much!I got it, I can access one computer by "ssh 10.1.9.2" from 10.1.9.1 , but It seems 10.1.9.2 cannot access to the internet.(10.1.9.1 has wireless connection).Do I have to set GATEWAY or BROASTCAST for 10.1.9.2?Thanx in advance!:)

exodist 04-11-2004 11:36 AM

you would need to configure the computer with wirelesss as a router, to do this you need to get bind (http://www.isc.org/), and iptables (http://www.netfilter.org/), bind is the dns server, ipfilters configures your routing and firewall, if you want to go it alone download those and read there man pages, but since that will not be enough (there is to much to figure out on your own in a reasonable ammount of time) I recommend this tutorial: http://www.tldp.org/HOWTO/IP-Masquer...WTO/index.html but it is VERY long and has more information than you need, and it does not cover dns, if you want the quick and dirty snag this script it lists: http://www.tldp.org/HOWTO/IP-Masquer...FIREWALL-2.4.X and make whatever changes you need for your network cards (eth0 eth1, etc.)

then you will need dns, the above will let you ping and browse sites by ip address, but to resolve the domain names (www.google.com for instance) you need the dns working also (both dns and iptables should run on the machine w/ the internet connection)
here is a good dns howto:
http://www.tldp.org/HOWTO/DNS-HOWTO.html I recommend you read this, it is not to long and will give you lots of valuable information about how networks work and how the internet woks, you will not be disappointed, but if you just want the quick and dirty (requires skimming still in other sections): http://www.tldp.org/HOWTO/DNS-HOWTO-5.html you need to read everything up till this, and then this, after it is just fine tuning and advanced settings.

this may seem overwhelming at first, but do not let it scare you off, and do not give up, 4 months into my linux usage I got 2 servers liek this up and running (sharing 2 56k connections) (5 years ago) and I even including dhcp (automatic IP address assignment)

oh, and after the router is configured you need to issue this command on the other box:

route add default gw 10.1.9.1 eth0 netmask 255.255.255.0

this will set the server (10.1.9.1) as your default router to connect to the internet, gw stands for gateway(router) I recommend reading the man pages and help for the route command it is confusing as hell and almost prevented me from succeeding

microsmart 04-12-2004 01:38 AM

Thank you very much!It's very kind of you.I've just begun using Linux for 2months, I'll try my best.I love Linux:p
Thanx a lot!


All times are GMT -5. The time now is 12:21 PM.