LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Not understanding network setup!! (https://www.linuxquestions.org/questions/linux-networking-3/not-understanding-network-setup-450646/)

vishamr2000 06-01-2006 01:53 PM

Not understanding network setup!!
 
Hi to all,

Code:

                +-------+  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?

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?

Warm regards,
Visham

iuaui 06-01-2006 03:38 PM

The reason doing that "/31" thing is to preserve IP addresses. But this mask gives only two IP addresses/network, so those networks have only network address and broadcast address. (This means that IP-spaces' first address is used as network address and last address is for broadcast. You can calculate it from bits left for "host" portion, meaning 32-31 = 1 bit ==> there is 2 addresses, first and last) Those network masks do not give any IP's for hosts.

My humble opinion is that /30 mask should be use for this kind of "networks". (32-30 = 2 bits which means four addresses, two for hosts and two for network and broadcast addresses)

This way using small address spaces also makes sure that ALL IP-ranges in 10.0.0.0 space are two adresses wide. Summa summarum: You have a enormous pile of small networks and you can't extend network space. All this kind of network "splitting" should be done from the tail, not from the head...


All times are GMT -5. The time now is 08:09 AM.