From owner-freebsd-questions@FreeBSD.ORG Fri Apr 11 07:21:01 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DD6537B401 for ; Fri, 11 Apr 2003 07:21:01 -0700 (PDT) Received: from pa-plum1b-166.pit.adelphia.net (pa-plum1b-122.pit.adelphia.net [24.53.161.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39FA943FA3 for ; Fri, 11 Apr 2003 07:21:00 -0700 (PDT) (envelope-from wmoran@potentialtech.com) Received: from potentialtech.com (working [172.16.0.95]) h3BEJgJP014989; Fri, 11 Apr 2003 10:19:42 -0400 (EDT) (envelope-from wmoran@potentialtech.com) Message-ID: <3E96CEFE.4030605@potentialtech.com> Date: Fri, 11 Apr 2003 10:19:42 -0400 From: Bill Moran User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2.1) Gecko/20030301 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jonathon McKitrick References: <20030411121053.GA77709@dogma.freebsd-uk.eu.org> In-Reply-To: <20030411121053.GA77709@dogma.freebsd-uk.eu.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: How to connect laptop and desktop w/NICs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 14:21:01 -0000 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 > laptop. 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 work. 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 In /etc/rc.conf network_interfaces="lo0 nic0" 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: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/nfs.html 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 Into /etc/rc.conf defaultrouter="172.16.0.1" Now try pinging 64.58.76.223 (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 (64.58.76.223). 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 too restrictive. Good luck ... and if you get stuck on a particular step, email the list with details of where you're stuck. -- Bill Moran Potential Technologies http://www.potentialtech.com