On Fri, 7 Aug 1998, David Irwin wrote:

> Run down on the problem:
>   I installed in my home a LAN which connected three windows machines
> together I then installed Linux on one of them. The machine doesn't
> have a modem and I'm having trouble connecting it through the network
> to the internet.

My advice: you're doing it backwards if you want to let the Win95 machine
serve the Linux machine.  Instead, put the modem in the Linux box (unless
it's a "WinModem", in that case throw it away and buy a real modem) and
have it act as a gateway/proxy for the network.  Win95 isn't exactly
optimized for these things, but Linux is.  It is also more featureful at
it. 

> The networking card installed properly (I assume) in the setup it has
> the proper io and irq addresses. The Linux machine is running the
> latest version of debian with an ip address of 90.0.0.6.

First, did you get that 90.0.0.6 as an officially assigned internet
address? If you have (which I doubt) then don't use a proxy, just use a
router (Win95 can't, Linux can easily.)  But since you're using a modem, I
suspect that you have an intermittent connection to a provider only and
just "took" the adresses yourself.  I strongly urge you to use 192.168.x.y
addresses (a "private" ip range) instead.  These addresses are not in use
on any "real" part of the internet and won't possibly lead to confusion.

On a Debian machine, the network interfaces are configured every time you
boot by a file "/etc/init.d/network".  It's a simple shell script that you
can edit to change the ip number or netmask of your network interfaces. 

Supposing that you're using the 192.168.1.x class C subnet, given the
linux host the ip address 192.168.1.6 and using some kind of
application-level only proxy (ie. no real ip routing) on a Win95 machine
on your network you /etc/init.d/network would look like this:

#!      /bin/sh
ifconfig lo 127.0.0.1
route add -net 127.0.0.0
IPADDR=192.168.1.6
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
GATEWAY=
ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
route add -net ${NETWORK}
[ "${GATEWAY}" ] && route add default gw ${GATEWAY} metric 1

It is more or less the same as on the Win95 machines, except for the ip
address, which is unique to each machine (and interface) and the "lo"
interface, that you don't declare on a win95 machine.

If the Win95 machine running a proxy has address 192.168.1.3, you would
then tell your applications to use the proxy on that address.

If however, you had a Linux machine with a modem connection to the
internet and doing ip-masquerading for the private network to which it is 
connected with an ethernet interface with ip address 192.168.1.3, you
could set GATEWAY=192.168.1.3 and you would not need any proxies for most
things.

First the basic setup of your linux machine of course.  If you want to get
the ip layer of your network working, but have trouble getting it to work
right, use the "ifconfig", "ping", "route", "arp", "traceroute" and
"netstat" commands for diagnosis and debugging. 

"/sbin/ifconfig" tells you what interfaces are up and what their ip
address and netmask atc. are.  "/bin/ping" tests if a remote interface is
reachable over the network.  "/sbin/route -n" shows the ip routing table,
if that isn't right, the packets are sent the wrong way.  "/usr/sbin/arp"
shows the arp cache, which caches hardware ethernet addresses of remote
network interfaces.  "/usr/sbin/traceroute" shows all the hops a packet
makes on its way to a remote interface, it's probably highly trivial on
your network, unless you have ICMP-masquerading working on the linux
machine.  "/bin/netstat" finally shows all kinds of stats on your
netwoking interfaces.

Before using these commands, you should read their manpages first, to get
a better impression of their uses and options than I can give you here.

Another piece of excellent documentation is "The Linux Network
Administrator's Guide" by Olaf Kirch.  You can grab it from
sunsite.unc.edu/LDP (IIRC) and print it or buy the book from O'Reilly.  It
is an excellent primer for the sort of thing you're trying to do.

On sunsite you'll also find a collection of HOWTO's, of which the
Net-3-HOWTO, ISP Hookup HOWTO, Intranet Server HOWTO, Firewall HOWTO and
IP Masquerade mini-HOWTO are particularly interesting.

> I'm running a proxy server on the one machine with an ip address of
> 90.0.0.5. Is it possible to connect through a proxy server?

Sure you can, if the application supports the type of proxy that's
availably on the win95 machine.  If you have a http proxy, then just tell
netscape or lynx about it and it should work.  If you want to ftp, you'll
need a ftp proxy.  If you install "apt" and use it as a dselect method,
you can download Debian updates over http, using the http proxy.

> I would like to know if it is possible to connect a Linux machine this
> way. My guess is I need some software which I'm unable to find for the
> 95 machine. Any help at all would be greatly appreciated.

Again, don't actually use a Win95 machine as a network server when you
have a linux machine that can do it much better.

Just setup the Linux box with a modem and a network card.  Install ppp on
the Linux machine and setup the connection to the ISP to work from linux.
Try the "pppconfig" command that Debian has.

Put a file in /etc/ppp/ip-up.d that sets up ip-masquearing with the
ipfwadm command (read all about it in its manpage and the HOWTO's) and put
a file in /etc/ppp/ip-down.d with commands that reset the masquerading
ruels.  That way, ip-masquerading is setup automatically every time you
dial in to your ISP.  You can also create a file /etc/ppp/ip-up.d/mail to
send and receive queued mail every time the ppp connection goes up.  Any
file you put in that directory is executed every time you dial in and a
ppp connection is established.

When this works, set the Win95 up with an ip address in the 192.168.1.x
range, with network, netmask and broadcast address just like the Linux
machine, but here, set the gateway to the Linux machine's ethernet
address.  The Linux machine will now act as a router for the Win95
machines, transparently translating their ip addresses and making it
appear as if they had real ip connectivity.  No need to make netscape use
a proxy.

You can go still further and install diald on the linux machine.  Diald is
a demand-dial daemon that dials your ISP whenever a network connection is
requested.  You can set rules for which type of connection request you
will or will not honour with a ppp link.  Read the manpage and the
Diald-HOWTO if you like it.

One more thing: for the networking features to work on the Linux machine,
its kernel has to support it.  IIRC the default kernel that comes with
Debian supports it, but I'm not sure, because I always build my own
kernels.  That's probably best for you too by the way (and use
kernel-package, install it and read /usr/doc/kernel-package/README) 
Be sure to enable ip-forwarding, ip-masquerading and whatever special
ip-masquerading feature you'll need.

If you want to use the default kernel, you may have to check if the
appropriate modules (network card, serial port, ppp, ipmasq modules) get
loaded at boot time.  For that to happen, they should be listed in
/etc/modules or else there should be a line "auto" in that file.  You may
also have to check /etc/conf.modules if it has the right parameters for
each of the modules. 

Have fun!


Joost

Reply via email to