[3998] in linux-net channel archive
Re: Subnetting, Arghh
daemon@ATHENA.MIT.EDU (Bernd Eckenfels)
Sun Aug 11 10:56:54 1996
To: submit-linux-dev-net@ratatosk.yggdrasil.com
From: ecki@inka.de (Bernd Eckenfels)
Date: 10 Aug 1996 03:57:04 GMT
Mogens Melander <mogens@frontier.dk> wrote:
: +--------------------+---------------+-----------+ +---> internet
: | | | | |
: +------+------+ +-----+----+ +-----+-----+ +-+---+-+
: |linux | |nameserver| |www server | |router |
: |pppd / diald | |mailserver| |ftp server | +-------+
: +-+--------+--+ +----------+ +-----------+
: | |
: | |
: ttyS0 +---- Net A ( 6 hosts)
: ttyS1 |
: ttySn +---- Net B (14 hosts)
: |
: +---- Net C (14 hosts)
: |
: +---- Net C (14 hosts)
You can use a small net for your ethernet and routes to the ppp-server for
the rest, or you can use proxy arp.
Static:
for router, www, nameserver you set up: (y==diffferent for each host)
ifconfig eth0 x.x.x.y netmask 255.255.255.248
route add -net x.x.x.0 netmask 255.255.255.248 dev eth0
route add -net x.x.x.0 netmask 255.255.255.0 gw x.x.x.z
for ppp:
ifconfig eth0 x.x.x.y netmask 255.255.255.248
route add -net x.x.x.0 netmask 255.255.255.248 dev eth0
additionally you need a default route on all systems except the router:
route add default gw router
The routes to the dial-in nets will be set with ip-up.
route add -net <net> netmask <netmask> dev ppp<x>
Proxy:
for router, www, nameserver,ppp you set up: (y==diffferent for each host)
ifconfig eth0 x.x.x.y netmask 255.255.255.0
route add -net x.x.x.0 netmask 255.255.255.0 dev eth0
additionally you need a default route on all systems except the router:
route add default gw router
Then in addition to each route for a dial-in net in ip-up, you add an proxy
arp entry:
route add -net <net> netmask <netmask> dev ppp<x>
arp -s <net> <hw> netmask <netmask> pub
net netmask (netadd,hosts,broadcast)
x.x.x.8 255.255.255.248 (8,9-14,15)
x.x.x.16 255.255.255.240 (16,17-30,31)
x.x.x.32 255.255.255.240 (32,33-46,47)
Of course you have to write a script which reads those numbers from a table
an sets them at each dialin. For pppd you can refer to
ftp.inka.de:/pub/comp/Linux/networking/ppp/ (for my 2.2.0f patc with example
scripts).
Greetings
Bernd
--
(OO) -- Bernd_Eckenfels@Wittumstrasse13.76646Bruchsal.de --
( .. ) ecki@lina.{inka.de,ka.sub.org} http://home.pages.de/~eckes/
o--o *plush* 2048/93600EFD eckes@irc +4972573817 *plush*
(O____O) If privacy is outlawed only Outlaws have privacy