IMPORTANT: Per accedir als fitxer de subversion: http://acacha.org/svn (sense password). Poc a poc s'aniran migrant els enllaços. Encara però funciona el subversion de la farga però no se sap fins quan... (usuari: prova i la paraula de pas 123456)

Esquema

Carlesrisa esquema osppf01.png

Introducció

Cal connectar dues xarxes locals entre sí mitjançant dos routers RB 750 els quals s'intercanvien les rutes per encaminament dinàmic amb OSPF

Documentació del procediment seguit

Ip calc

realitzarem la comanda ip calc per calcula les ip

Exemple

ipcalc 172.16.1.1/29
Address: 172.16.1.1 10101100.00010000.00000001.00000 001
Netmask: 255.255.255.248 = 29 11111111.11111111.11111111.11111 000
Wildcard: 0.0.0.7 00000000.00000000.00000000.00000 111
=>
Network: 172.16.1.0/29 10101100.00010000.00000001.00000 000
HostMin: 172.16.1.1 10101100.00010000.00000001.00000 001
HostMax: 172.16.1.6 10101100.00010000.00000001.00000 110
Broadcast: 172.16.1.7 10101100.00010000.00000001.00000 111
Hosts/Net: 6 Class B, Private Internet
ipcalc 172.16.1.2/29
Address: 172.16.1.2 10101100.00010000.00000001.00000 010
Netmask: 255.255.255.248 = 29 11111111.11111111.11111111.11111 000
Wildcard: 0.0.0.7 00000000.00000000.00000000.00000 111
=>
Network: 172.16.1.0/29 10101100.00010000.00000001.00000 000
HostMin: 172.16.1.1 10101100.00010000.00000001.00000 001
HostMax: 172.16.1.6 10101100.00010000.00000001.00000 110
Broadcast: 172.16.1.7 10101100.00010000.00000001.00000 111
Hosts/Net: 6 Class B, Private Internet
ipcalc 192.168.40.1/24
Address: 192.168.40.1 11000000.10101000.00101000. 00000001
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.40.0/24 11000000.10101000.00101000. 00000000
HostMin: 192.168.40.1 11000000.10101000.00101000. 00000001
HostMax: 192.168.40.254 11000000.10101000.00101000. 11111110
Broadcast: 192.168.40.255 11000000.10101000.00101000. 11111111
Hosts/Net: 254 Class C, Private Internet 
ipcalc 192.168.50.1/24
Address: 192.168.50.1 11000000.10101000.00110010. 00000001
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 192.168.50.0/24 11000000.10101000.00110010. 00000000
HostMin: 192.168.50.1 11000000.10101000.00110010. 00000001
HostMax: 192.168.50.254 11000000.10101000.00110010. 11111110
Broadcast: 192.168.50.255 11000000.10101000.00110010. 11111111
Hosts/Net: 254 Class C, Private Internet

Ip Aliasing

Per no pedre la connecció a internet farem un ip aliasing.

Exemple

Configuració R1

address list

Posar les ip's de cada adaptador

Carlesrisa ospfR101.png

Configuracio Instancia

Carlesrisa ospfR102.png

Posar la id i el nom

Networks

Carlesrisa ospfR103.png

Posar les 2 networks que volem compartir amb el vei

Interfaces

Carlesrisa ospfR104.png

filtres per a la clase A

Carlesrisa ospfR105.png

Creem els filtres ospf-in per les ips de classe A


10.0.0.0/8 reject

Creem els filtres ospf-out per les ips de classe A


10.0.0.0/8 discard



Configuració R2

address list

Posar les ip's de cada adaptador

Carlesrisa ospfR201.png

Configuracio Instancia

Carlesrisa ospfR202.png

Posar la id i el nom

Networks

Carlesrisa ospfR203.png

Posar les 2 networks que volem compartir amb el vei

Interfaces

Carlesrisa ospfR204.png

filtres per a la clase A

Carlesrisa ospfR205.png

Creem els filtres ospf-in per les ips de classe A


10.0.0.0/8 reject

Creem els filtres ospf-out per les ips de classe A


10.0.0.0/8 discard

Comprovacions

ping

ping router 1

Carlesrisa ospfR106.png

ping router 2

Carlesrisa ospfR206.png

Rutes

rutes router1

Carlesrisa ospfR107.png

rutes router 2

Carlesrisa ospfR207.png

Ping desde maquina a router

Ping de maquina 1 a router 2

[email protected]:~$ sudo ifconfig wlan0:11 192.168.40.18/24
[email protected]:~$ sudo route add default gw 192.168.40.1
[email protected]:~$ ping 192.168.40.1
PING 192.168.40.1 (192.168.40.1) 56(84) bytes of data.
64 bytes from 192.168.40.1: icmp_req=1 ttl=64 time=1.06 ms
64 bytes from 192.168.40.1: icmp_req=2 ttl=64 time=0.461 ms

Ping de maquina 2 a router 1

[email protected]:~$ sudo ifconfig wlan0:22 192.168.50.18/24
[email protected]:~$ sudo route add default gw 192.168.50.1

[email protected]:~$ ping 192.168.50.1
PING 192.168.50.1 (192.168.50.1) 56(84) bytes of data.
64 bytes from 192.168.50.1: icmp_req=1 ttl=63 time=1.31 ms
64 bytes from 192.168.50.1: icmp_req=2 ttl=63 time=1.26 ms
64 bytes from 192.168.50.1: icmp_req=3 ttl=63 time=1.20 ms

Exports

Router1

# jun/19/2013 19:45:23 by RouterOS 6.1
# software id = Y8ZJ-57ZJ
#
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
mac-cookie-timeout=3d
/routing ospf instance
set [ find default=yes ] name=risa01 redistribute-connected=as-type-1 \
redistribute-other-ospf=as-type-1 router-id=0.0.0.100
/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
permissions=owner signup-allowed=no time-zone=-00:00
/ip address
add address=172.16.1.1/29 interface=ether2 network=172.16.1.0
add address=192.168.40.1/24 interface=ether3 network=192.168.40.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/routing filter
add action=discard chain=ospf-in prefix=10.0.0.0/8
add action=discard chain=ospf-out prefix=10.0.0.0/8
/routing ospf network
add area=backbone network=172.16.1.0/29
add area=backbone network=192.168.40.0/24
/system identity
set name=Risa01
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s

Router2

# jun/19/2013 19:46:09 by RouterOS 6.1
# software id = 46X3-T823
#
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
mac-cookie-timeout=3d
/routing ospf instance
set [ find default=yes ] name=risa02 redistribute-connected=as-type-1 \
redistribute-other-ospf=as-type-1 router-id=0.0.0.200
/tool user-manager customer
add backup-allowed=yes disabled=no login=admin password="" \
paypal-accept-pending=no paypal-allowed=no paypal-secure-response=no \
permissions=owner signup-allowed=no time-zone=-00:00
/ip address
add address=172.16.1.2/29 interface=ether2 network=172.16.1.0
add address=192.168.50.1/24 interface=ether3 network=192.168.50.0
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
/routing filter
add action=discard chain=ospf-in prefix=10.0.0.0/8
add action=discard chain=ospf-out prefix=10.0.0.0/8
/routing ospf network
add area=backbone network=172.16.1.0/29
add area=backbone network=192.168.50.0/24
/system identity
set name=Risa02
/system lcd
set contrast=0 enabled=no port=parallel type=24x4
/system lcd page
set time disabled=yes display-time=5s
set resources disabled=yes display-time=5s
set uptime disabled=yes display-time=5s
set packets disabled=yes display-time=5s
set bits disabled=yes display-time=5s
set version disabled=yes display-time=5s
set identity disabled=yes display-time=5s
set ether1 disabled=yes display-time=5s
set ether2 disabled=yes display-time=5s
set ether3 disabled=yes display-time=5s
set ether4 disabled=yes display-time=5s

Vegeu també

OSPF

ipcalc

Enllaços externs

cisco wiki