Динамическая маршрутизация в FreeBSD с BIRD, Quagga
under
получить список подсетей из кваги и залить по ftp
http://subnets.ru/wrapper.php?p=7
http://subnets.ru/blog/?p=1728
http://subnets.ru/blog/?p=19
http://subnets.ru/forum/viewtopic.php?f=3&t=371&start=30
hostname AS123456
password zebra
enable password zebra
log file /var/log/bgpd.log
router bgp 123456
bgp router-id 173.45.248.98
bgp log-neighbor-changes
no synchronization
network 48.151.4.0/23
neighbor 173.45.248.97 remote-as 45975
neighbor 178.45.248.97 next-hop-self
neighbor 178.45.248.97 route-map ROSTELEKOM_IN in
neighbor 178.45.248.97 route-map ROSTELEKOM_OUT out
!
ip prefix-list bogons description bogus nets
ip prefix-list bogons seq 15 permit 0.0.0.0/8 le 32
ip prefix-list bogons seq 20 permit 127.0.0.0/8 le 32
ip prefix-list bogons seq 30 permit 10.0.0.0/8 le 32
ip prefix-list bogons seq 35 permit 172.16.0.0/12 le 32
ip prefix-list bogons seq 40 permit 192.168.0.0/16 le 32
ip prefix-list bogons seq 45 permit 169.254.0.0/16 le 32
ip prefix-list bogons seq 50 permit 224.0.0.0/4 le 32
ip prefix-list bogons seq 55 permit 240.0.0.0/4 le 32
ip prefix-list default description default route
ip prefix-list default seq 10 permit 0.0.0.0/0
ip prefix-list our-CIDR-blocks seq 5 permit 48.151.4.0/23 le 32
ip prefix-list upstream-out seq 10 permit 48.151.4.0/23
!
ip as-path access-list 1 permit _6451[2-9]_
ip as-path access-list 1 permit _645[2-9][0-9]_
ip as-path access-list 1 permit _64[6-9][0-9][0-9]_
ip as-path access-list 1 permit _65[0-9][0-9][0-9]_
!
route-map ROSTELEKOM_IN deny 100
match as-path 1
!
route-map ROSTELEKOM_IN deny 110
match ip address prefix-list bogons
!
route-map ROSTELEKOM_IN deny 115
match ip address prefix-list default
!
route-map ROSTELEKOM_IN deny 120
match ip address prefix-list our-CIDR-blocks
!
route-map ROSTELEKOM_IN permit 200
set local-preference 100
!
route-map ROSTELEKOM_OUT permit 100
match ip address prefix-list upstream-out
!
route-map ROSTELEKOM_OUT deny 200
gw# vtysh
Hello, this is Quagga (version 0.99.21).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
gw#
clear Reset functions
configure Configuration from vty interface
copy Copy from one file to another
debug Enable debug messages for specific or all part.
disable Turn off privileged mode command
end End current mode and change to enable mode
exit Exit current mode and down to previous mode
list Print command list
no Negate a command or set its defaults
ping Send echo messages
quit Exit current mode and down to previous mode
show Show running system information
ssh Open an ssh connection
start-shell Start UNIX shell
telnet Open a telnet connection
terminal Set terminal line parameters
traceroute Trace route to destination
undebug Disable debugging functions (see also 'debug')
write Write running configuration to memory, network, or terminal
gw#
получить список подсетей из кваги и залить по ftp
#!/bin/bash
# получить список подсетей AS и залить на фтп
file=/tmp/zebra/peering_as_subnets
echo "sh ip ro bgp" | vtysh | grep 127,0,0.1 | awk {'print $2'} > $file
echo "send $file" | pftp lt.lan
rm $file