Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!news From: Ken Bigelow <kbigelow@www.play-hookey.com> Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: Two devices with same IP Date: Sat, 23 Nov 1996 12:38:12 +0000 Organization: Erol's Internet Services Lines: 56 Message-ID: <3296F034.7F00@www.play-hookey.com> References: <56ltqk$nhv@csugrad.cs.vt.edu> <56lvvc$62f$1@gail.ripco.com> <32920988.63E7@www.play-hookey.com> <571pde$mp8@sf18.dseg.ti.com> <nigel.20.0000C75A@znet.net.au> <574f3l$2s4@anorak.utell.net> Reply-To: kbigelow@www.play-hookey.com NNTP-Posting-Host: kenjb05.play-hookey.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win16; U) Brian Somers wrote: > > In article <nigel.20.0000C75A@znet.net.au>, > nigel@znet.net.au (Nigel Gorry) writes: > : > : An ifconfig -a on my machine show that I have the same IP address for both my > : NIC and PPP interfaces. This works as a router with the default route being > : via the remote side of the PPP link. > : > : ed0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500 > : inet 203.61.202.20 netmask 0xfffffff0 broadcast 203.61.202.31 > : lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 > : inet 127.0.0.1 netmask 0xff000000 > : tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 > : inet 203.61.202.20 --> 203.61.202.1 netmask 0xffffff00 > > I don't get this. First, how come you're broadcasting on an address outside > of your network on ed0 ? ed0's netmask says that the allowable range is > 203.61.202.{16-23} ! You're misreading the range. Netmask 0xfffffff0 gives 16 nodes in the subnet, from 16-31 in this case. An 8-node subnet would have a netmask of 0xfffffff8. > > If the above machine sends a packet to 203.61.202.{16-19,21-22} (assuming > that 203.61.202.16 is your net address and 203.61.202.23 is your *real* > broadcast address, how does your kernel know which of ed0 and tun0 to send > the packet ? His tun0 connection is to his ISP's node at 203.61.202.1, with an assumed netmask of 0xffffff00 (full Class C). My ppp0 configuration is similar: ppp0: inet 206.161.179.129 --> 205.252.116.183 netmask 0xffffff00 All computers on my subnet use 206.161.179.129 as their gateway spec, except for this computer, which serves as my local gateway. *Its* gateway to the Internet is 205.252.116.183, which is the IP address of the fixed port I am leasing from my ISP. A packet from any computer to a destination outside of my subnet gets routed to odin, my gateway computer. Since it can't handle the packet itself, it routes the packet to its gateway, which is my ISP. From there, it's their problem. Packets coming back are first recognized by my ISP. A packet for any computer in my subnet is routed to 206.161.179.129 (odin), which either handles it directly if so addressed, or gates it onto my subnet for recognition by one of the other computers. My ISP won't send me packets destined elsewhere, and it won't accept packets from me if they come from outside of the assigned subnet range. -- Ken Are you interested in | byte-sized education | http://www.play-hookey.com over the Internet? |