How redistribute routes from kernel table to OSPF protocol?

2012-02-22 Thread Владислав Гришин
1. Routes into kernel routing table

proxmox-host1:/# ip ro list
10.18.1.25 dev venet0  scope link
10.18.1.26 dev venet0  scope link
10.16.1.0/24 dev vmbr0  proto kernel  scope link  src 10.16.1.27
10.17.1.0/24 dev eth1  proto kernel  scope link  src 10.17.1.27
default via 10.16.1.1 dev vmbr0
proxmox-host1:/#

2. Bird Config file 

filter export_OSPF {
# redistribute connected
if ( source = RTS_DEVICE ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}
# redistribute static
if ( source = RTS_STATIC_DEVICE ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}

if ( source = RTS_STATIC ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}

reject;
}

filter import_OSPF {
if ( source = RTS_OSPF_EXT2  net != 0.0.0.0/0 ) then {
print net accepted:, net;
accept;
}
reject;
}

protocol direct {
interface eth1;
interface venet0;
}

protocol kernel {
#   table main;
learn;  # Learn all alien routes from the kernel
device routes;
#   persist off;# Don't remove routes on bird shutdown
#   scan time 20;   # Scan kernel routing table every 20 seconds
scan time 2;# Scan kernel routing table every 60 seconds
import all; # Default is import all
export all; # Default is export none
#   kernel table 5; # Kernel table to synchronize with (default:
main)
}
protocol ospf myospf {
router id 10.17.1.27;
debug all;
export filter export_OSPF;
import filter import_OSPF;
area 0.0.0.0 {
interface eth1 {
hello 10;
retransmit 5;
cost 10;
transmit delay 1;
dead count 4;
wait 40;
type broadcast;
priority 0;
authentication cryptographic;
password ХХ;
};
};
}

3. Output bird console

bird show route all
0.0.0.0/0  via 10.16.1.1 on vmbr0 [kernel1 2012-02-22 12:47:54] *
(10)
Type: inherit unicast univ
10.16.1.0/24   via 10.17.1.28 on eth1 [myospf 2012-02-22 12:48:04] * E2
(150/10/20) [10.17.1.28]
Type: OSPF-boundary unicast univ
OSPF.metric1: 10
OSPF.metric2: 20
OSPF.tag: 0x
OSPF.router_id: 10.17.1.28
10.17.1.0/24   dev eth1 [direct1 2012-02-22 12:47:54] * (240)
Type: device unicast univ
bird

But I don't see these routes in a bird

10.18.1.25 dev venet0  scope link
10.18.1.26 dev venet0  scope link

(Only default route present from kernel.)

It is necessary to declare these routes to OSPF neighbors.

Vladislav Grishin




RE: How redistribute routes from kernel table to OSPF protocol?

2012-02-22 Thread Владислав Гришин

After I restart bird

proxmox-host1:/var/log# tail /var/log/debug
Feb 22 14:59:09 proxmox-host1 bird: kernel1: Pruning inherited routes
Feb 22 14:59:11 proxmox-host1 bird: device1: Scanning interfaces
Feb 22 14:59:11 proxmox-host1 bird: kernel1: Scanning routing table
Feb 22 14:59:11 proxmox-host1 bird: kernel1: 10.18.1.25/32: ignored  --
Feb 22 14:59:11 proxmox-host1 bird: kernel1: 10.18.1.26/32: ignored  --
Feb 22 14:59:11 proxmox-host1 bird: kernel1: 0.0.0.0/0: [alien] seen
Feb 22 14:59:11 proxmox-host1 bird: kernel1: Pruning table master
Feb 22 14:59:11 proxmox-host1 bird: kernel1: 10.16.1.0/24: reinstalling
Feb 22 14:59:11 proxmox-host1 bird: kernel1: 10.17.1.0/24: reinstalling
Feb 22 14:59:11 proxmox-host1 bird: kernel1: Pruning inherited routes
proxmox-host1:/var/log#

Vladislav Grishin

-Original Message-
From: owner-bird-us...@atrey.karlin.mff.cuni.cz
[mailto:owner-bird-us...@atrey.karlin.mff.cuni.cz] On Behalf Of Владислав
Гришин
Sent: Wednesday, February 22, 2012 1:23 PM
To: bird-us...@trubka.network.cz
Subject: How redistribute routes from kernel table to OSPF protocol?

1. Routes into kernel routing table

proxmox-host1:/# ip ro list
10.18.1.25 dev venet0  scope link
10.18.1.26 dev venet0  scope link
10.16.1.0/24 dev vmbr0  proto kernel  scope link  src 10.16.1.27
10.17.1.0/24 dev eth1  proto kernel  scope link  src 10.17.1.27
default via 10.16.1.1 dev vmbr0
proxmox-host1:/#

2. Bird Config file 

filter export_OSPF {
# redistribute connected
if ( source = RTS_DEVICE ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}
# redistribute static
if ( source = RTS_STATIC_DEVICE ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}

if ( source = RTS_STATIC ) then {
print net accepted:, net;
ospf_metric2 = 20;
accept;
}

reject;
}

filter import_OSPF {
if ( source = RTS_OSPF_EXT2  net != 0.0.0.0/0 ) then {
print net accepted:, net;
accept;
}
reject;
}

protocol direct {
interface eth1;
interface venet0;
}

protocol kernel {
#   table main;
learn;  # Learn all alien routes from the kernel
device routes;
#   persist off;# Don't remove routes on bird shutdown
#   scan time 20;   # Scan kernel routing table every 20 seconds
scan time 2;# Scan kernel routing table every 60 seconds
import all; # Default is import all
export all; # Default is export none
#   kernel table 5; # Kernel table to synchronize with (default:
main)
}
protocol ospf myospf {
router id 10.17.1.27;
debug all;
export filter export_OSPF;
import filter import_OSPF;
area 0.0.0.0 {
interface eth1 {
hello 10;
retransmit 5;
cost 10;
transmit delay 1;
dead count 4;
wait 40;
type broadcast;
priority 0;
authentication cryptographic;
password ХХ;
};
};
}

3. Output bird console

bird show route all
0.0.0.0/0  via 10.16.1.1 on vmbr0 [kernel1 2012-02-22 12:47:54] *
(10)
Type: inherit unicast univ
10.16.1.0/24   via 10.17.1.28 on eth1 [myospf 2012-02-22 12:48:04] * E2
(150/10/20) [10.17.1.28]
Type: OSPF-boundary unicast univ
OSPF.metric1: 10
OSPF.metric2: 20
OSPF.tag: 0x
OSPF.router_id: 10.17.1.28
10.17.1.0/24   dev eth1 [direct1 2012-02-22 12:47:54] * (240)
Type: device unicast univ
bird

But I don't see these routes in a bird

10.18.1.25 dev venet0  scope link
10.18.1.26 dev venet0  scope link

(Only default route present from kernel.)

It is necessary to declare these routes to OSPF neighbors.

Vladislav Grishin






scan time of protocol kernel

2010-07-28 Thread Владислав Гришин

Hi,

Now 'scan time' set to 60 sec. The bird load system up to 100% during 10-12
sec every 60 sec.

What circumstances to take into consideration that it is correct to set
'scan time' of protocol kernel?

If I do not add paths with linux the console, whether I can delete 'scan
time' from the protocol kernel?

Vladislav Grishin




Error after I add RTS_OSPF_EXT in filter

2010-07-14 Thread Владислав Гришин

I change filter from 

filter import_exclude_default {
if ( source != RTS_BGP  net != 0.0.0.0/0 ) then {
print net accepted:, net;
ospf_metric1 = 60;
accept;
}
reject;
}

to

filter import_exclude_default {
if ( source = RTS_OSPF_INT  net != 0.0.0.0/0 ) then {
print net accepted:, net;
ospf_metric1 = 60;
accept;
}
reject;
}

after 'configure soft' I see error

bird configure soft
Reading configuration from /etc/bird.conf
/etc/bird.conf, line 167: RTS_OSPF_INT: variable expected.
bird


From documentation 

5.5 Route attributes
...

enum source
what protocol has told me about this route. Possible values: RTS_DUMMY,
RTS_STATIC, RTS_INHERIT, RTS_DEVICE, RTS_STATIC_DEVICE, RTS_REDIRECT,
RTS_RIP, RTS_OSPF, RTS_OSPF_IA, RTS_OSPF_EXT, RTS_BGP, RTS_PIPE.


Why I receive error?


Vladislav Grishin



RE: Error after I add RTS_OSPF_EXT in filter

2010-07-14 Thread Владислав Гришин

Ok.

I have changed filter. Now he is 

if ( source = RTS_OSPF_EXT  net != 0.0.0.0/0 )



bird configure soft
Reading configuration from /etc/bird.conf
/etc/bird.conf, line 167: RTS_OSPF_EXT: variable expected.
bird
bird


Error again.

I have checked all from possible values: RTS_DUMMY,
RTS_STATIC, RTS_INHERIT, RTS_DEVICE, RTS_STATIC_DEVICE, RTS_REDIRECT,
RTS_RIP, RTS_OSPF, RTS_OSPF_IA, RTS_OSPF_EXT, RTS_BGP, RTS_PIPE.


Only RTS_OSPF_EXT don't work.


PS
RTS_OSPF_INT  - It is my carelessness

Vladislav Grishin


-Original Message-
From: owner-bird-us...@atrey.karlin.mff.cuni.cz
[mailto:owner-bird-us...@atrey.karlin.mff.cuni.cz] On Behalf Of Ondrej
Zajicek
Sent: Wednesday, July 14, 2010 5:27 PM
To: ? ??
Cc: bird-us...@trubka.network.cz
Subject: Re: Error after I add RTS_OSPF_EXT in filter

On Wed, Jul 14, 2010 at 04:41:12PM +0400, ? ?? wrote:
 
 filter import_exclude_default {
 if ( source = RTS_OSPF_INT  net != 0.0.0.0/0 ) then {

...

 what protocol has told me about this route. Possible values: RTS_DUMMY,
 RTS_STATIC, RTS_INHERIT, RTS_DEVICE, RTS_STATIC_DEVICE, RTS_REDIRECT,
 RTS_RIP, RTS_OSPF, RTS_OSPF_IA, RTS_OSPF_EXT, RTS_BGP, RTS_PIPE.
 
 
 Why I receive error?

Because the values are RTS_OSPF, RTS_OSPF_IA and RTS_OSPF_EXT,
not RTS_OSPF_INT.

RTS_OSPF is for plain, intra-area OSPF routes.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.



RE: Whether are compatible Cisco IOS and BIRD at usage OSPF MD5ofauthentification?

2010-07-13 Thread Владислав Гришин

Yes.

Right config of cisco

interface Vlan550
 ip address 10.10.1.3 255.255.255.128
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 7 15220D080E26292F2E6760
 ip ospf priority 5
!

-Original Message-
From: owner-bird-us...@atrey.karlin.mff.cuni.cz
[mailto:owner-bird-us...@atrey.karlin.mff.cuni.cz] On Behalf Of Ondrej
Zajicek
Sent: Tuesday, July 13, 2010 5:32 PM
To: ? ??
Cc: 'Vitaliy Kolodinsky'; bird-us...@trubka.network.cz
Subject: Re: Whether are compatible Cisco IOS and BIRD at usage OSPF
MD5ofauthentification?

On Tue, Jul 13, 2010 at 04:57:27PM +0400, ? ?? wrote:
 
 Debug output of cisco 3550 after I insert command 'ip ospf lls disable'.
 
 ...
 interface Vlan550
  ip address 10.10.1.3 255.255.255.128
  ip ospf authentication
  ip ospf message-digest-key 1 md5 7 15220D080E26292F2E6760
  ip ospf priority 5
  ip ospf lls disable
 ...
 
 10.10.1.1 and 10.10.1.2 is IPs of bird.
 
 3550-L3-S1#debug ip ospf events
 OSPF events debugging is on
 3550-20a-L3-S1#debug ip ospf hello
 OSPF hello events debugging is on
 3550-20a-L3-S1#
 *Mar 16 02:45:55.637: OSPF: Send hello to 224.0.0.5 area 0 on Vlan550 from
 10.10.1.3
 *Mar 16 02:45:55.637: OSPF: Rcv pkt from 10.10.1.2, Vlan550 : Mismatch
 Authentication type. Input packet specified type 2, we use type 1
 *Mar 16 02:45:56.593: OSPF: end of Wait on interface Vlan550
 *Mar 16 02:45:56.593: OSPF: DR/BDR election on Vlan550
 *Mar 16 02:45:56.593: OSPF: Elect BDR 10.10.1.3
 *Mar 16 02:45:56.593: OSPF: Elect DR 10.10.1.3
 *Mar 16 02:45:56.593: OSPF: Elect BDR 0.0.0.0
 *Mar 16 02:45:56.593: OSPF: Elect DR 10.10.1.3
 *Mar 16 02:45:56.593:DR: 10.10.1.3 (Id)   BDR: none
 *Mar 16 02:45:57.093: OSPF: No full nbrs to build Net Lsa for interface
 Vlan550
 *Mar 16 02:45:58.049: OSPF: Rcv pkt from 10.10.1.1, Vlan550 : Mismatch
 Authentication type. Input packet specified type 0, we use type 1
 *Mar 16 02:46:04.821: OSPF: Rcv pkt from 10.10.1.2, Vlan550 : Mismatch
 Authentication type. Input packet specified type 2, we use type 1

I don't have much experience with Cisco, but i would guess that
you have configured Cisco to use plaintext passwords (type 1)
instead of MD5 auth (type 2).

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.



RE: Delay after interrupt output

2010-07-12 Thread Владислав Гришин

I have another computer with Intel(R) Pentium(R) Dual  CPU  @ 2.20GHz and
2048MB, delay is 4 sec. BGP receive full view (320k routes).


Vladislav Grishin.

-Original Message-
From: Ondrej Zajicek [mailto:santi...@crfreenet.org] 
Sent: Monday, July 12, 2010 1:02 PM
To: ? ??
Cc: bird-us...@trubka.network.cz
Subject: Re: Delay after interrupt output

On Mon, Jul 12, 2010 at 12:08:33PM +0400, ? ?? wrote:
 
 BGP protocol receive full view.
 
 If during review of the table of routing by ' show route ' command to
 interrupt output having pressed a key ' q ', bird long thinks. I wait for
 appearance ' bird ' approximately 7 seconds. Such delay on Cisco routers
is
 not present. With such delay it is very inconvenient to work with birdc.

There is a delay because scrolling and interrupting of output is
implemented solely in birdc and bird always generates full output that
takes a time. OTOH, on testing masine with Pentium 2, 2 Ghz with full
BGP feed (320k routes) i got a delay ~ 1.5 s. Usually this is not
a problem because users anyway have to use filtered show route cmd
to cope with many routes.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
To err is human -- to blame it on a computer is even more so.



BGP Error: No listening socket

2010-07-10 Thread Владислав Гришин

Hi!

I have been forced to change customisations of network interfaces on a
server with bird. After modification bird.conf I has checked up availability
of BGP neighbors. Everything is all right. ping ok. telnet ip of bgp
neighbor 179 - ok. After restart bird see error in/var/log/messges 

May 12 10:03:01 border-t2 bird: Reconfiguring
May 12 10:03:01 border-t2 bird: Enabling protocol bgpfiord
May 12 10:03:01 border-t2 bird: Enabling protocol bgpabonent
May 12 10:03:01 border-t2 bird: Reconfigured
May 12 10:03:01 border-t2 bird: sk_open: bind: Cannot assign requested
address
May 12 10:03:01 border-t2 bird: BGP: Unable to open listening socket
May 12 10:03:01 border-t2 bird: sk_open: bind: Cannot assign requested
address
May 12 10:03:01 border-t2 bird: BGP: Unable to open listening socket

OSPF the protocol works perfectly. BGP no.

[r...@border-t2 etc]# ping 93.191.9.205
PING 93.191.9.205 (93.191.9.205) 56(84) bytes of data.
64 bytes from 93.191.9.205: icmp_seq=1 ttl=64 time=0.799 ms
64 bytes from 93.191.9.205: icmp_seq=2 ttl=64 time=0.824 ms
64 bytes from 93.191.9.205: icmp_seq=3 ttl=64 time=0.836 ms

--- 93.191.9.205 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.799/0.819/0.836/0.036 ms
[r...@border-t2 etc]#

bird show protocols myospf
name prototablestate  since   info
myospf   OSPF master   up 09:37   Running
bird
bird show protocols bgpabonent
name prototablestate  since   info
bgpabonent BGP  testable down   10:02   Error: No listening socket
bird
bird show protocols bgpfiord
name prototablestate  since   info
bgpfiord BGP  master   down   10:02   Error: No listening socket
bird

[r...@border-t2 ~]# birdc
BIRD 1.2.3 ready.
bird show interfaces
lo up (index=1)
MultiAccess AdminUp LinkUp Loopback Ignored MTU=16436
127.0.0.1/8 (Primary, broadcast 127.255.255.255, scope host)
eth0 DOWN (index=2)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
eth1 DOWN (index=3)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
eth2 up (index=4)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
10.16.1.73/24 (Primary, broadcast 10.16.1.255, scope site)
eth0.20 up (index=5)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
192.168.20.1/24 (Primary, broadcast 192.168.20.255, scope site)
eth0.701 up (index=6)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
93.191.9.206/30 (Primary, broadcast 93.191.9.207, opposite
93.191.9.205, scope univ) -FOR bgpfiord
eth1.10 up (index=8)
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
192.168.10.1/24 (Primary, broadcast 192.168.10.255, scope site)
eth1.550 up (index=9) --FOR OSPF and bgpabonent
MultiAccess Broadcast Multicast AdminUp LinkUp MTU=1500
10.10.1.2/25 (Primary, broadcast 10.10.1.127, scope site)
sit0 DOWN (index=10)
MultiAccess AdminUp LinkDown MTU=1480
bird
bird show interfaces summary
interface state address
loup127.0.0.1/8
eth0  DOWN
eth1  DOWN
eth2  up10.16.1.73/24
eth0.20   up192.168.20.1/24
eth0.701  up93.191.9.206/30--for bgpfiord
eth1.10   up192.168.10.1/24
eth1.550  up10.10.1.2/25--for bgpabonent and myospf
sit0  DOWN
bird


I can not understand in any way that happens? What to check up?

Vladislav Grishin



RE: Why filter not work for two cases?

2010-07-10 Thread Владислав Гришин

Почему лучший маршрут в таблице маршрутизации из протокола статик а не из
протокола BGP ?



Vladislav Grishin