From owner-freebsd-mobile Fri Dec 26 14:09:14 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA08626 for mobile-outgoing; Fri, 26 Dec 1997 14:09:14 -0800 (PST) (envelope-from owner-freebsd-mobile) Received: from grizzly.fas.com (chs0295.awod.com [208.140.97.55]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id OAA08620 for ; Fri, 26 Dec 1997 14:09:06 -0800 (PST) (envelope-from stanb@awod.com) Message-Id: <199712262209.OAA08620@hub.freebsd.org> Received: by grizzly.fas.com ($Revision: 1.37.109.23 $/16.2) id AA255944137; Fri, 26 Dec 1997 17:08:57 -0500 Subject: Help with alternate network and ppp setup To: freebsd-mobile@freebsd.org (FreeBSD Mobile List) Date: Fri, 26 Dec 1997 17:08:56 -0500 (EST) From: "Stan Brown" X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-mobile@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I am having a problem getting my FreeBSD laptop to work exactly the way I want it to. Here is the situation. The machine has a PCMCIA etherent card in it and might find it self connected to any one of 3 different networks. In addation I want to be able to dial into my home network and connect to it using PPP. Some kind soul sent me a small perl script that I have made a few minor changes to for the multi netwrk setup here it is. #!/usr/local/bin/perl %gateway = ('205.159.77.233' => { gw => '205.159.77.234', dns => ['205.159.77.240', '208.140.99.9', '198.81.225.1'], dom => 'fas.com' }, '222.198.37.141' => { gw => '222.198.37.254', dns => ['192.1.37.20'], dom => 'westvaco.com' }, '192.168.0.3 -link0' => { gw => '192.168.0.1', dns => ['192.168.0.1'], dom => 'westvaco.com' }, ); `route delete default 2>&1 > /dev/null`; foreach $key (keys(%gateway)) { $thiskey = $key; $up=1; `ifconfig ep0 inet $key netmask 0xffffff00 link1`; unless (system("ping -c 1 $gateway{$key}{gw} > /dev/null")) { last; } print "Cannot ping $gateway{$key}{gw}\n"; $up=0; } if($up) { `route add default $gateway{$thiskey}{gw}`; open RESOLVFILE, "> /etc/resolv.conf"; print RESOLVFILE "domain $gateway{$thiskey}{dom}\n"; foreach $ipnum (@{$gateway{$thiskey}{dns}}) { print RESOLVFILE "nameserver $ipnum\n"; } close RESOLVFILE; if($gateway{$thiskey}{dom} eq 'fas.com') { `ypbind beach`; } print "Configured for network $gateway{$thiskey}{dom}\n"; } else { print "Cannot find a known network\n"; } This script is invoked from thee pccard script. Y have put NO in the sysconfig file for the functions handled by this script. This seems to work OK. Primarly I have tested it on my home network. Now I am trying to get the machine to dial up and do aPPP link to one of the computers on my home network. I have the chat script and all that working and can get a PPP prompt. I can then telnet to the machine that I have conected to. At this point, I can't get to anu other machines on my network, much less the outsde world. Also somehow in hacking on this I have reached the point where when brought up on my local network rwho and ruptime don't work on this machine. As a matter of fact, It sees thother machines, but not itslef! Here is the output of netstat -r and ifconfig -a after booting on my local network. Script started on Fri Dec 26 17:05:39 1997 ]0;stan@polar.fas.com;/home/stanstan@polar.fas.com:/home/stan $ netstat -r Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default koala UGSc 5 33 ep0 localhost localhost UH 2 134 lo0 205.159.77 link#5 UC 0 0 polar 0:20:af:c7:2d:af UHLW 0 9 lo0 koala link#5 UHLW 6 1 kodiak 8:0:9:78:ea:56 UHLW 2 13977 ep0 857 grizzly 8:0:9:11:e5:a UHLW 4 34881 ep0 857 205.159.77.255 ff:ff:ff:ff:ff:ff UHLWb 0 2 ep0 ]0;stan@polar.fas.com;/home/stanstan@polar.fas.com:/home/stan $ ifconfig -a lp0: flags=8810 mtu 1500 tun0: flags=8010 mtu 1500 sl0: flags=c010 mtu 552 lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 ep0: flags=a843 mtu 1500 inet 205.159.77.233 netmask 0xffffff00 broadcast 205.159.77.255 ether 00:20:af:c7:2d:af ]0;stan@polar.fas.com;/home/stanstan@polar.fas.com:/home/stan $ WhatI think* is going on here, is that there are still some remnants of the attempts to talk to the non-exustent betworsk. Does this make sense? Has anyone else worked through this? Script done on Fri Dec 26 17:05:50 1997 -- Stan Brown stanb@netcom.com 770-996-6955 Factory Automation Systems Atlanta Ga. -- Look, look, see Windows 95. Buy, lemmings, buy! Pay no attention to that cliff ahead... Henry Spencer (c) 1997 Stan Brown. Redistribution via the Microsoft Network is prohibited.