Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2003 15:11:35 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to connect laptop and desktop w/NICs
Message-ID:  <20030411141135.GD82425@happy-idiot-talk.infracaninophi>
In-Reply-To: <20030411121053.GA77709@dogma.freebsd-uk.eu.org>
References:  <20030411121053.GA77709@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--48TaNjbzBVislYPb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 11, 2003 at 01:10:53PM +0100, Jonathon McKitrick wrote:
>=20
> Hi all,
>=20
> I am making a first foray into home networking.  I have little (read: non=
e)
> experience in this.  All I have done is my firewall for my dialup on my
> laptop.
>=20
> My new desktop box just had 4.8 installed, and the laptop is 4.7.  Both h=
ave
> NIC cards.  I have a set of cables and a switch, and also a direct
> (crossover) network cable.

Ummm... Plug a cable in to each NIC and then connect to the central
switch?  Make sure the switch is powered up, and that it has green
(for values of green that can include yellow or amber depending on the
model of switch you're using) lights showing to say it's detected the
connection to your two machines.  There may also be LEDs on your NICs
that show that you've got a connection there.  Now try bringing up the
interface on each machine:

On the desktop:

    ifconfig xl0 inet 192.168.0.1/24 up

on the laptop:

    ifconfig fxp0 inet 192.168.0.2/24 up

where (obviously) you should substitute the correct device names for
xl0 and fxp0.

Now you should be able to test basic connectivity by pinging one
machine from the other:

    ping 192.168.0.2

and you should see lights flash on the networking kit to indicate
activity, and the ping command should show packets coming back with a
round-trip time of about 1ms ish on 100mb/s networks.

That's basically it for a local connection.  You can put entries into
/etc/hosts to map hostnames onto those IP numbers for ease of use, and
you can add entries to /etc/rc.conf to make the interfaces
autoconfigure on boot up:

    ifconfig_xl0=3D"inet 192.168.0.1 netmask 0xffffff00"

You could also use your crossover cable to make a direct connection
machine to machine, but in that case you will have to override the
autodetection of link speed etc., and make sure both ends are running
at the same speed and duplex settings:

    ifconfig_xl0=3D"inet 192.168.0.1 netmask 0xffffff00 media 100baseTX med=
iaopt full-duplex"

but generally it's easier just to plug into a switch and let it work
out the settings automatically.
=20
> What is the easiest way to=20
> Connect my laptop to my desktop for file transfers?

As above.
=20
> Also, I followed basic instructions for setting up natd and a gateway on =
the
> laptop so I could dial out and have the desktop use it as a gateway, but =
the
> desktop does not seem to recognize anything beyond its NIC card.  What st=
eps
> should I follow to figure out where my config is wrong?

On your laptop you need to have:

    gateway_enable=3D"YES"

in /etc/rc.conf, or it won't route packets between it's interfaces.

On your desktop you need to have:

    defaultrouter=3D"192.168.0.2"

(ie. the IP number of your laptop) as the default route to send any
packets not detined for locally attached networks.

You should also beware that the firewall on your laptop permits your
desktop machine to pass packets to and fro.  It's probably best to
temporarily disable your firewall while your working out how the
networking goes together --- just add a 'pass all' rule that short
circuits the rest of the ruleset:

    ipfw add 1 add allow ip from any to any

and that you can delete once you're done:

    ipfw delete 1=20

(That way, if you lose connectivity when you bring the firewall back
up, you know it's that which must have caused it.)

For diagnosing problems with networking, always start by verifying
that the physical connectivity is there.  Inspect the cabling and make
sure that RJ45 jacks are pushed home into sockets.  Make sure the
blinkenlights are showing the correct status.  Use 'netstat -i' to see
if you're getting any errors on the interfaces: you shouldn't be
getting any on a home network although you may see collisions if
you're not on a full-duplex setup.

Once you've eliminated the local hardware, start to think further
afield.  Use ping(8) to test that you can get packets to and fro using
the IP number of another machine on the same local network.  Then ping
machines further away or use traceroute to determine where the problem
is.  Use tcpdump(1) to look at the network traffic on intermediate
gateways.  Remember that problems with the DNS can give the effect of
being unable to connect to a remote site, even though the networking
setup is perfectly sound: use 'dig' or 'host' to verify that you can
resolve hostnames into IP numbers.

A good introductory text on IP networking is the Crab book "TCP/IP
Network Administration" by Craig Hunt
(http://www.oreilly.com/catalog/tcp3/)

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--48TaNjbzBVislYPb
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+ls0XdtESqEQa7a0RAp7XAJ0eljPoHFDjwP/3KK6yTNXY98iTrgCghgBd
FXYvyrtdTM5z55S7qZqaJkw=
=aeTq
-----END PGP SIGNATURE-----

--48TaNjbzBVislYPb--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030411141135.GD82425>