How to connect laptop and desktop w/NICs
wmoran at potentialtech.com
Fri Apr 11 07:21:01 PDT 2003
Jonathon McKitrick wrote:
> Hi all,
> I am making a first foray into home networking. I have little (read: none)
> experience in this. All I have done is my firewall for my dialup on my
Welcome to a new world ;)
> My new desktop box just had 4.8 installed, and the laptop is 4.7. Both have
> NIC cards. I have a set of cables and a switch, and also a direct
> (crossover) network cable.
> What is the easiest way to
> Connect my laptop to my desktop for file transfers?
Physically speaking ... you can either connect them directly with the crossover
or you can put the switch in between and plug the lappy and desktop into the
switch. There's an outside possibility that the crossover might not work
(hardware compat problems) so don't be afraid to try one if the other doesn't
As to which is easier, that kind of depends on your opintion. Neither way is
terribly difficult, and you'll config things the same wichever way you use.
> 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 steps
> should I follow to figure out where my config is wrong?
First, make sure plugging everything in causes the lights on NICs and switch to
come on in the proper manner ... this isn't 100% indicator that everything's
wired correctly (sometimes the lights will come on when things aren't wired
correctly) but it's a good start.
Next, use the ifconfig command to assign IP addresses to the machines. Make
the desktop 172.16.0.2 and the lappy 172.16.0.1. From the command line:
ifconfig nic0 inet 172.16.0.1 netmask 255.255.255.0
ifconfig_nic0="inet 172.16.0.1 netmask 255.255.255.0"
Substitute the driver for you card for "nic0" You can find out what driver is
connected to your card by looking at dmesg output.
Once they're both set, test to make sure everything works by pinging. Ping
172.16.0.1 from the desktop and 172.16.0.2 from the lappy. If you get responses,
then things are good. If not, go back and figure out what step was done wrong,
or you'll never get the next steps done.
Now your basic network is configured.
To get file-sharing set up, read this and give it a try:
To get the connection sharing working ... you basically need 2 things:
1) Set the laptop as your default route. From the command line:
route add default 172.16.0.1
Now try pinging 188.8.131.52 (that's yahoo) If that works ... great! If not,
(and the previous pings worked) they your natd config isn't right yet. Work
on that before moving to the next step.
2) Set up DNS. DNS turns names (www.yahoo.com) into IP addresses (184.108.40.206).
Your DNS client config is in the file /etc/resolv.conf. When you dial out, your
ISP most likely provides DNS information that the ppp program uses to create
/etc/resolv.conf. So the easiest thing to do is copy the /etc/resolv.conf on the
lappy to the desktop. It's probably less than 5 lines, so you can just read it
off the lappy and type it into the desktop.
Now try pinging www.yahoo.com ... if it's works, you're golden!
You said you had a firewall. I would turn it off while you're doing this. If you
get through all these steps, turn the firewall back on and test it again. That
way you know whether you did the network config wrong or if you have your firewall
Good luck ... and if you get stuck on a particular step, email the list with
details of where you're stuck.
More information about the freebsd-questions