RE: Not understanding network setup!!

Linux Advanced Routing and Traffic Control

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

 



-----Original Message-----
From: lartc-bounces@xxxxxxxxxxxxxxx
[mailto:lartc-bounces@xxxxxxxxxxxxxxx] On Behalf Of
ramsurrunv@xxxxxxxxxxxx
Sent: Thursday, June 01, 2006 2:58 PM
To: lartc@xxxxxxxxxxxxxxx
Subject:  Not understanding network setup!! 

> Hi to all,
> 
>                  +-------+   eth1   +-------+
>                  |       |==========|       |
>  'network 1' ----|   A   |          |   B   |---- 'network 2'
>                  |       |==========|       |
>                  +-------+   eth2   +-------+
> 
> A and B are routers
> 
> # tc qdisc add dev eth1 root teql0
> # tc qdisc add dev eth2 root teql0
> # ip link set dev teql0 up
> 
> On router A:
>
> # ip addr add dev eth1 10.0.0.0/31
> # ip addr add dev eth2 10.0.0.2/31
> # ip addr add dev teql0 10.0.0.4/31
> 
> On router B:
> 
> # ip addr add dev eth1 10.0.0.1/31
> # ip addr add dev eth2 10.0.0.3/31
> # ip addr add dev teql0 10.0.0.5/31
> 
> 
> The above has been quoted from LARTC HOWTO. I would like to know the
> following things:
> 
> 1) Are the 10.0.0.0/31, 10.0.0.2/31, 10.0.0.3/31...different networks?
Are
> the devices eth1, eth2 and teql0 on each router part of 3 different
> networks?

I very much doubt the above was quoted on the LARTC HOWTO. Please point
us to where you saw this. It is completely wrong. 

First, 10.0.0.0/31 would be a network address. Second, a 31 bit subnet
is meaningless. It only offers two addresses, the network address at
10.0.0.0 and the broadcast address at 10.0.0.1. That leaves no available
addresses for host addresses. You probably mean /30 instead of /31. If
you were using a /30, then you would run:

ip addr add 10.0.0.1/30 dev eth1
ip addr add 10.0.0.5/30 dev eth2
ip addr add 10.0.0.9/30 dev teql0

The .1, .5, and .9 would be the first available addresses in their
respective subnets.

On router B, you would run:

ip addr add 10.0.0.2/30 dev eth1
ip addr add 10.0.0.6/30 dev eth2
ip addr add 10.0.0.10/30 dev teql0

The .2, .6, and .10 addresses would be the second and final available
host addresses on their respective subnets. 

And yes, each device sits on a different network when configured like
this. The teql0 device simply lets you load balance across the two eth
devices.

> 2) What is the reason for doing the "/31" thing? CAn't we use network
> addresses such as 192.168.0.0/24, 192.168.10.0/24 and so on for the
> devices eth1, eth2 and teql0?


You could use the 192.168.0.0/24 type addresses just as easily. The only
difference is in how many addresses are available for hosts on the
network block. By using a /30, you allow 2 host addresses and only 2
host addresses. Using the /24 network, you allow 254 host addresses.
That seems rather wasteful when all you need is 2, doesn't it?

 
Eliot Gable
Certified Wireless Network Administrator (CWNA)
Certified Wireless Security Professional (CWSP)
Cisco Certified Network Associate (CCNA)
CompTIA Security+ Certified
CompTIA Network+ Certified
Network and System Engineer
Great Lakes Internet, Inc.
112 North Howard
Croswell, MI 48422
(810) 679-3395
(877) 558-8324
 
Now offering Broadband Wireless Internet access in Croswell, Lexington,
Brown City, Yale, Worth Township, and Sandusky. Call for
details.http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux