[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: faking the hardware address?



On Fri, May 15, 1998 at 10:25:06PM -0600, Rick Macdonald wrote:
> Nils, I'm trying to do the _exact_ same thing, except instead of PPP I
> have two ethernet interfaces.
And that makes all the difference because ethernet is a broadcast network
not point to point as for PPP. See below.

> I believe my setup is correct and I believe that it doesn't work
> because the "campus network" in my case is a cable modem and the cable
> company hasn't properly set me up to use the 5 static IP addresses that
> they have given me to use.
> 
> I actually just need three IP's: two for my ethernet cards and one for
> the machine on the local lan.
> 
> Here I've numbered my IPs just like your campus example, but I've added
> the third address, 1.2.3.3, for my second ethernet card (for my local
> lan) where the other fellow is using PPP.
> 
> If you don't mind eyeballing this, I'd be very grateful!
> 
> #eth0 is the cable modem side. The hardware address in the arp
> #command is the one from my eth0 interface (the cable modem side).
> 

> #  configure the IP address, netmask and broadcast address.
> /sbin/ifconfig eth0 1.2.3.1 netmask 255.255.255.0 broadcast 1.2.3.255
> # add a network route to point to it:
> /sbin/route add -net 1.2.3.0 device eth0
> # Add a default route.                             
> /sbin/route add default gw 1.2.3.254
ok so far.

> arp -s 1.2.3.2 00:10:4B:1E:A4:1B pub
This is ok too. but see option 2) below

> # eth1 is the Win95 local lan side:
> 
> /sbin/ifconfig eth1 1.2.3.3 netmask 255.255.255.0 broadcast 1.2.3.255
This won't work.

you have two devices (eth0 and eth1) both with the same network (1.2.3.0)
and the same netmask. The kernel can't know where to put the packages.

You could try:
1)
ifconfig eth1 1.2.3.1 pointopoint 1.2.3.2
route add -host 1.2.3.2 device eth1

and as the 1.2.3.2 host is a win95 box, that certainly can't handle ethernet
in pointopoint mode, you need

arp -s 1.2.3.0 <hardware address of eth1> netmask 255.255.255.0 pub


I never tried that. I don't know if ethx interfaces like to be or may be put
at all in pointopoint mode. Could make sense however with a twisted Twisted
pair...

2)
(This one needs a few more addresses, but it is clean and will work)
ifconfig eth0 1.2.3.4 netmask 255.255.255.0 broadcast 1.2.3.255
route add -net 1.2.3.0 device eth0

ifconfig eth1 1.2.3.1 netmask 255.255.255.252 broadcast 1.2.3.3
route add -net 1.2.3.0 device eth1

and on the win95 side set IP address 1.2.3.2, netmask 255.255.255.252 and
default gateway 1.2.3.1 I hope win95 understands netmasks that are not on
byte boundaries ... If not, use IP 1.2.3.2, netmask 255.255.255.0,
default gateway 1.2.3.1 and add 

arp -eth1 -s 1.2.3.0 <hardware address of eth1> netmask 255.255.255.0 pub

as setup command on the linux box.

Nils

--
*-----------------------------------------------------------------------------*
| Quotes from the net:  L> Linus Torvalds, W> Winfried Truemper               |
| L>this is the special easter release of linux, more mundanely called 1.3.84 |
| W>Umh, oh. What do you mean by "special easter release"?. Will it quit      |
* W>working today and rise on easter?                                         *

Attachment: pgpjuJiwi2B99.pgp
Description: PGP signature


Reply to: