SlideShare une entreprise Scribd logo
1  sur  15
Télécharger pour lire hors ligne
picobgp

     ● non-compliant-bgp
     ● routing advertising
     ● tolopogy update
     ● tiny and easy to use



                          for picobgp v0.2


CC-BY: Claudio Mignanti (2012)
picobgp - Take over of your vpn

picobgp was written to automatically setup routing inside a vpn,
but can be used also in a generic net.

Suppose that you have some vpn peers, serverA and your
laptop.
Now serverA is also part of a local lan, say 10.0.8.0/24 and you
want that your laptop can reach all the serverA-lan with
minimus effort.

picobgp can help you!
192.168.6.1



              192.168.6.2



        10.0.8.9
vpn0: 192.168.6.1



           vpn0:192.168.6.2



       eth0: 10.0.8.9
vpn0: 192.168.6.1

    # pbgp -i vpn0

                                    vpn0:192.168.6.2



# pbgp -i vpn0 -s 10.0.8.0/24   eth0: 10.0.8.9
picobgp - command args

picobgp DOESN'T support             Supported args in v0.2 are:
configuration with files but only
by cmdline args.                      -1
                                          one-shot advertising
Supported args in v0.1 are:            (useful inside script)
-i <interface>                         -c
   Specify the outgoing interface         cascade
-s x.x.x.x/y                           annunce the subnet received.
   Specify the subnet               This option can lead to routing
   (option can be repeated for      loop!
each subnet)                        KEEP your network in tree
                                    forms!!!
and don't forgot to...

.. enable routing on your servers


echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
# pbgp -i eth0 -s 10.1.1.9/29


eth1: 10.1.1.1
                      # pbgp -i eth1 -s 192.168.1.0/24

                      # pbgp -i eth0 -s 10.1.1.0/29
eth0: 192.168.1.2
                      NetbookB cannot access 10.1.1.9/29



                       # pbgp -i eth0

            A more complex example
# pbgp -i eth0 -s 10.1.1.9/29


  eth1: 10.1.1.1
                        # pbgp -i eth1 -s 192.168.1.0/24

                        # pbgp -c -i eth0 -s 10.1.1.0/29
  eth0: 192.168.1.2
                      ServerB announce also ServerA subnet



                         # pbgp -i eth0

On v0.1+ the -c option allow the propagation of
                   subnets
picobgp as daemon

Daemon mode un-supported for choice.

# ./pbgp -cs 1.1.1.0/24 & >/dev/null 2>&1

is what you are looking for...


Do you like to know why this choice?
picobgp inside scripts

We want to annouce a given subnet if a host inside the
subnet reply to ping
#!/bin/bash

while 1; do
  ping -c 1 192.168.1.9 && pbgp -1s 192.168.1.0/24
  sleep 5
done


-1 option is one-shot and die mode (thanks Clauz for the idea)
Behind the scene

The bgpmsg struct is            In update_rt() function this
inizialized with the program    structure is used to inizialize
args and than spammed on        a struct rtentry and then
iface broadcast address         passed to a ioctl that
every 3 seconds.                manipolate the kernel route
                                table.
typedef struct sbgpmsg {        ioctl (sd, SIOCADDRT, &rtentry);
     struct in_addr addr;
     struct in_addr netmask;    If a subnet is not spammed
     struct in_addr loc_addr;   for more that 10 secs the
     time_t l_update;           route entry is deleted.
} bgpmsg;
what's next?!?!??!

KNOW ISSUE for v0.1:            TODO:
* msg are broadcast using         ideas?
255.255.255.255 and is not
using the effective broadcast
address of the passed
interface
* DELRT show be bogus
Use picobgp for redundant gateway

HostA has 10.0.1.9 inside it
LAN 10.0.1.0/24 and the gws
are 10.0.1.1 and 10.0.1.2

We want to setup the route

Contenu connexe

Tendances

3 manual installation of open vpn
3 manual installation of open vpn3 manual installation of open vpn
3 manual installation of open vpnAshwajit Maske
 
Linux Server Start
Linux Server StartLinux Server Start
Linux Server StartGavin Quan
 
AHA-best-msf-interface-ever
AHA-best-msf-interface-everAHA-best-msf-interface-ever
AHA-best-msf-interface-everkernelsmith
 
How to burn your GPU with CUDA9.1
How to burn your GPU with CUDA9.1How to burn your GPU with CUDA9.1
How to burn your GPU with CUDA9.1Naoto MATSUMOTO
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCKernel TLV
 
Install Cuckoo on Mac OS X
Install Cuckoo on Mac OS XInstall Cuckoo on Mac OS X
Install Cuckoo on Mac OS XMohd Khairulazam
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMMarian Marinov
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?ScyllaDB
 
Contemporary Linux Networking
Contemporary Linux NetworkingContemporary Linux Networking
Contemporary Linux NetworkingMaximilan Wilhelm
 
sshuttle VPN (2011-04)
sshuttle VPN (2011-04)sshuttle VPN (2011-04)
sshuttle VPN (2011-04)apenwarr
 
Pound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de CargaPound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de Cargagsroma
 
Destination NAT.docx
Destination NAT.docxDestination NAT.docx
Destination NAT.docxHritikGupta56
 
How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-Naoto MATSUMOTO
 
自分だけのデバイスを作るお話
自分だけのデバイスを作るお話自分だけのデバイスを作るお話
自分だけのデバイスを作るお話kishima7
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control GroupsMarian Marinov
 
今さら聞けないAWS on Rails
今さら聞けないAWS on Rails今さら聞けないAWS on Rails
今さら聞けないAWS on RailsYuumi Yoshida
 

Tendances (20)

3 manual installation of open vpn
3 manual installation of open vpn3 manual installation of open vpn
3 manual installation of open vpn
 
Linux Server Start
Linux Server StartLinux Server Start
Linux Server Start
 
ExaProxy
ExaProxyExaProxy
ExaProxy
 
AHA-best-msf-interface-ever
AHA-best-msf-interface-everAHA-best-msf-interface-ever
AHA-best-msf-interface-ever
 
How to burn your GPU with CUDA9.1
How to burn your GPU with CUDA9.1How to burn your GPU with CUDA9.1
How to burn your GPU with CUDA9.1
 
Building Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCCBuilding Network Functions with eBPF & BCC
Building Network Functions with eBPF & BCC
 
Jslinux
JslinuxJslinux
Jslinux
 
Install Cuckoo on Mac OS X
Install Cuckoo on Mac OS XInstall Cuckoo on Mac OS X
Install Cuckoo on Mac OS X
 
LSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVMLSA2 - 01 Virtualization with KVM
LSA2 - 01 Virtualization with KVM
 
OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?OSNoise Tracer: Who Is Stealing My CPU Time?
OSNoise Tracer: Who Is Stealing My CPU Time?
 
Contemporary Linux Networking
Contemporary Linux NetworkingContemporary Linux Networking
Contemporary Linux Networking
 
Logging kernel oops and panic
Logging kernel oops and panicLogging kernel oops and panic
Logging kernel oops and panic
 
sshuttle VPN (2011-04)
sshuttle VPN (2011-04)sshuttle VPN (2011-04)
sshuttle VPN (2011-04)
 
Pound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de CargaPound & Varnish - Cache e Balanceamento de Carga
Pound & Varnish - Cache e Balanceamento de Carga
 
Destination NAT.docx
Destination NAT.docxDestination NAT.docx
Destination NAT.docx
 
How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-How to ride a 100GbE LAN -MEMO-
How to ride a 100GbE LAN -MEMO-
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
自分だけのデバイスを作るお話
自分だけのデバイスを作るお話自分だけのデバイスを作るお話
自分だけのデバイスを作るお話
 
LSA2 - 02 Control Groups
LSA2 - 02   Control GroupsLSA2 - 02   Control Groups
LSA2 - 02 Control Groups
 
今さら聞けないAWS on Rails
今さら聞けないAWS on Rails今さら聞けないAWS on Rails
今さら聞けないAWS on Rails
 

En vedette

Make $80 to $100 Daily
Make $80 to $100 DailyMake $80 to $100 Daily
Make $80 to $100 DailyGayle Bailey
 
Help and hoarding by Annette Conway, Psy.D.
Help and hoarding by Annette Conway, Psy.D.Help and hoarding by Annette Conway, Psy.D.
Help and hoarding by Annette Conway, Psy.D.scott4hlp
 
The wright brothers started with a glider before going to powered flight.
The wright brothers started with a glider before going to powered flight.The wright brothers started with a glider before going to powered flight.
The wright brothers started with a glider before going to powered flight.InsuranceNebraska
 
Mr Holdings car
Mr Holdings carMr Holdings car
Mr Holdings carhuzguc7k
 
Happy Birthday MORGAN!!!
Happy Birthday MORGAN!!!Happy Birthday MORGAN!!!
Happy Birthday MORGAN!!!lbly
 
Bella Vista Affordable House and lot
Bella Vista Affordable House and lotBella Vista Affordable House and lot
Bella Vista Affordable House and lotipropertyphilippines
 
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 RomaOpenwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 RomaClaudio Mignanti
 
Virus y vacunas expo.claudia parra
Virus y vacunas expo.claudia parraVirus y vacunas expo.claudia parra
Virus y vacunas expo.claudia parraClau Parra
 
Help and hoarding
Help and hoardingHelp and hoarding
Help and hoardingscott4hlp
 
Mr holdins car
Mr holdins carMr holdins car
Mr holdins carhuzguc7k
 
AFP, Poliovirus, Enteroviruses,
AFP, Poliovirus, Enteroviruses, AFP, Poliovirus, Enteroviruses,
AFP, Poliovirus, Enteroviruses, Fibamicro1
 
Your face _farsi_
Your face _farsi_Your face _farsi_
Your face _farsi_Fibamicro1
 
Mr holdings car
Mr holdings carMr holdings car
Mr holdings carhuzguc7k
 
El perfume
El perfumeEl perfume
El perfumeKlad314
 
Trabjo de redes porcentaje
Trabjo de redes porcentajeTrabjo de redes porcentaje
Trabjo de redes porcentajebetsy_vera
 
The city of bicycles
The city of bicyclesThe city of bicycles
The city of bicyclesAntje Huang
 

En vedette (20)

Make $80 to $100 Daily
Make $80 to $100 DailyMake $80 to $100 Daily
Make $80 to $100 Daily
 
Help and hoarding by Annette Conway, Psy.D.
Help and hoarding by Annette Conway, Psy.D.Help and hoarding by Annette Conway, Psy.D.
Help and hoarding by Annette Conway, Psy.D.
 
The wright brothers started with a glider before going to powered flight.
The wright brothers started with a glider before going to powered flight.The wright brothers started with a glider before going to powered flight.
The wright brothers started with a glider before going to powered flight.
 
311
311311
311
 
Mr Holdings car
Mr Holdings carMr Holdings car
Mr Holdings car
 
Slideshare
SlideshareSlideshare
Slideshare
 
Happy Birthday MORGAN!!!
Happy Birthday MORGAN!!!Happy Birthday MORGAN!!!
Happy Birthday MORGAN!!!
 
Libro1nnn (1)
Libro1nnn (1)Libro1nnn (1)
Libro1nnn (1)
 
Bella Vista Affordable House and lot
Bella Vista Affordable House and lotBella Vista Affordable House and lot
Bella Vista Affordable House and lot
 
Openwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 RomaOpenwrt, linux e GPIO al LinuxDay 2010 Roma
Openwrt, linux e GPIO al LinuxDay 2010 Roma
 
Virus y vacunas expo.claudia parra
Virus y vacunas expo.claudia parraVirus y vacunas expo.claudia parra
Virus y vacunas expo.claudia parra
 
мой город
мой городмой город
мой город
 
Help and hoarding
Help and hoardingHelp and hoarding
Help and hoarding
 
Mr holdins car
Mr holdins carMr holdins car
Mr holdins car
 
AFP, Poliovirus, Enteroviruses,
AFP, Poliovirus, Enteroviruses, AFP, Poliovirus, Enteroviruses,
AFP, Poliovirus, Enteroviruses,
 
Your face _farsi_
Your face _farsi_Your face _farsi_
Your face _farsi_
 
Mr holdings car
Mr holdings carMr holdings car
Mr holdings car
 
El perfume
El perfumeEl perfume
El perfume
 
Trabjo de redes porcentaje
Trabjo de redes porcentajeTrabjo de redes porcentaje
Trabjo de redes porcentaje
 
The city of bicycles
The city of bicyclesThe city of bicycles
The city of bicycles
 

Similaire à Setup redundant gateways with picobgp

Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Hajime Tazaki
 
Intro to router_config
Intro to router_configIntro to router_config
Intro to router_configarjuntrk
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEVJasper Nuyens
 
Intro to router_config
Intro to router_configIntro to router_config
Intro to router_config97148881557
 
ELC-E Linux Awareness
ELC-E Linux AwarenessELC-E Linux Awareness
ELC-E Linux AwarenessPeter Griffin
 
Automating auto-scaled load balancer based on linux and vm orchestrator
Automating auto-scaled load balancer based on linux and vm orchestratorAutomating auto-scaled load balancer based on linux and vm orchestrator
Automating auto-scaled load balancer based on linux and vm orchestratorAndrew Yongjoon Kong
 
BIRD Routing Daemon
BIRD Routing DaemonBIRD Routing Daemon
BIRD Routing DaemonAPNIC
 
Cisco data center support
Cisco data center supportCisco data center support
Cisco data center supportKrunal Shah
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...idsecconf
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Keisuke Takahashi
 
managing your network environment
managing your network environmentmanaging your network environment
managing your network environmentscooby_doo
 
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013Đồng Quốc Vương
 
Rip 2 docoments version 1.1 by deepak kumar
Rip 2 docoments version 1.1 by deepak kumarRip 2 docoments version 1.1 by deepak kumar
Rip 2 docoments version 1.1 by deepak kumarDeepak Kumar
 
Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/LinuxAhmed Mekkawy
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksLaurent Bernaille
 

Similaire à Setup redundant gateways with picobgp (20)

Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01
 
Inter as vpn option c
Inter as vpn option c Inter as vpn option c
Inter as vpn option c
 
Intro to router_config
Intro to router_configIntro to router_config
Intro to router_config
 
ENSA_Module_10.pptx
ENSA_Module_10.pptxENSA_Module_10.pptx
ENSA_Module_10.pptx
 
Tesla Hacking to FreedomEV
Tesla Hacking to FreedomEVTesla Hacking to FreedomEV
Tesla Hacking to FreedomEV
 
Ccnav5.org ccna 3-v50_final_exam_2014
Ccnav5.org ccna 3-v50_final_exam_2014Ccnav5.org ccna 3-v50_final_exam_2014
Ccnav5.org ccna 3-v50_final_exam_2014
 
Intro to router_config
Intro to router_configIntro to router_config
Intro to router_config
 
ELC-E Linux Awareness
ELC-E Linux AwarenessELC-E Linux Awareness
ELC-E Linux Awareness
 
Automating auto-scaled load balancer based on linux and vm orchestrator
Automating auto-scaled load balancer based on linux and vm orchestratorAutomating auto-scaled load balancer based on linux and vm orchestrator
Automating auto-scaled load balancer based on linux and vm orchestrator
 
BIRD Routing Daemon
BIRD Routing DaemonBIRD Routing Daemon
BIRD Routing Daemon
 
Cisco data center support
Cisco data center supportCisco data center support
Cisco data center support
 
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
Information Theft: Wireless Router Shareport for Phun and profit - Hero Suhar...
 
Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5Trying and evaluating the new features of GlusterFS 3.5
Trying and evaluating the new features of GlusterFS 3.5
 
managing your network environment
managing your network environmentmanaging your network environment
managing your network environment
 
Linux router
Linux routerLinux router
Linux router
 
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013
Www ccnav5 net_ccna_3_v5_0_scaling_networks_final_exam_2013
 
Rip 2 docoments version 1.1 by deepak kumar
Rip 2 docoments version 1.1 by deepak kumarRip 2 docoments version 1.1 by deepak kumar
Rip 2 docoments version 1.1 by deepak kumar
 
Networking in Gnu/Linux
Networking in Gnu/LinuxNetworking in Gnu/Linux
Networking in Gnu/Linux
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 

Plus de Claudio Mignanti

Pycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and KubernetesPycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and KubernetesClaudio Mignanti
 
Roma linuxday 2013 - nodejs
Roma linuxday 2013 - nodejsRoma linuxday 2013 - nodejs
Roma linuxday 2013 - nodejsClaudio Mignanti
 
Elettronica digitale with Example
Elettronica digitale with ExampleElettronica digitale with Example
Elettronica digitale with ExampleClaudio Mignanti
 
Presentazione Ninux al LinuxDay Roma 2012
Presentazione Ninux al LinuxDay Roma 2012Presentazione Ninux al LinuxDay Roma 2012
Presentazione Ninux al LinuxDay Roma 2012Claudio Mignanti
 

Plus de Claudio Mignanti (8)

Pycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and KubernetesPycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and Kubernetes
 
Grunt.js introduction
Grunt.js introductionGrunt.js introduction
Grunt.js introduction
 
Roma linuxday 2013 - nodejs
Roma linuxday 2013 - nodejsRoma linuxday 2013 - nodejs
Roma linuxday 2013 - nodejs
 
Presentazione tirocinio
Presentazione tirocinio Presentazione tirocinio
Presentazione tirocinio
 
TuxIsAlive
TuxIsAliveTuxIsAlive
TuxIsAlive
 
Elettronica digitale with Example
Elettronica digitale with ExampleElettronica digitale with Example
Elettronica digitale with Example
 
Git for dummies
Git for dummiesGit for dummies
Git for dummies
 
Presentazione Ninux al LinuxDay Roma 2012
Presentazione Ninux al LinuxDay Roma 2012Presentazione Ninux al LinuxDay Roma 2012
Presentazione Ninux al LinuxDay Roma 2012
 

Setup redundant gateways with picobgp

  • 1. picobgp ● non-compliant-bgp ● routing advertising ● tolopogy update ● tiny and easy to use for picobgp v0.2 CC-BY: Claudio Mignanti (2012)
  • 2. picobgp - Take over of your vpn picobgp was written to automatically setup routing inside a vpn, but can be used also in a generic net. Suppose that you have some vpn peers, serverA and your laptop. Now serverA is also part of a local lan, say 10.0.8.0/24 and you want that your laptop can reach all the serverA-lan with minimus effort. picobgp can help you!
  • 3.
  • 4. 192.168.6.1 192.168.6.2 10.0.8.9
  • 5. vpn0: 192.168.6.1 vpn0:192.168.6.2 eth0: 10.0.8.9
  • 6. vpn0: 192.168.6.1 # pbgp -i vpn0 vpn0:192.168.6.2 # pbgp -i vpn0 -s 10.0.8.0/24 eth0: 10.0.8.9
  • 7. picobgp - command args picobgp DOESN'T support Supported args in v0.2 are: configuration with files but only by cmdline args. -1 one-shot advertising Supported args in v0.1 are: (useful inside script) -i <interface> -c Specify the outgoing interface cascade -s x.x.x.x/y annunce the subnet received. Specify the subnet This option can lead to routing (option can be repeated for loop! each subnet) KEEP your network in tree forms!!!
  • 8. and don't forgot to... .. enable routing on your servers echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
  • 9. # pbgp -i eth0 -s 10.1.1.9/29 eth1: 10.1.1.1 # pbgp -i eth1 -s 192.168.1.0/24 # pbgp -i eth0 -s 10.1.1.0/29 eth0: 192.168.1.2 NetbookB cannot access 10.1.1.9/29 # pbgp -i eth0 A more complex example
  • 10. # pbgp -i eth0 -s 10.1.1.9/29 eth1: 10.1.1.1 # pbgp -i eth1 -s 192.168.1.0/24 # pbgp -c -i eth0 -s 10.1.1.0/29 eth0: 192.168.1.2 ServerB announce also ServerA subnet # pbgp -i eth0 On v0.1+ the -c option allow the propagation of subnets
  • 11. picobgp as daemon Daemon mode un-supported for choice. # ./pbgp -cs 1.1.1.0/24 & >/dev/null 2>&1 is what you are looking for... Do you like to know why this choice?
  • 12. picobgp inside scripts We want to annouce a given subnet if a host inside the subnet reply to ping #!/bin/bash while 1; do ping -c 1 192.168.1.9 && pbgp -1s 192.168.1.0/24 sleep 5 done -1 option is one-shot and die mode (thanks Clauz for the idea)
  • 13. Behind the scene The bgpmsg struct is In update_rt() function this inizialized with the program structure is used to inizialize args and than spammed on a struct rtentry and then iface broadcast address passed to a ioctl that every 3 seconds. manipolate the kernel route table. typedef struct sbgpmsg { ioctl (sd, SIOCADDRT, &rtentry); struct in_addr addr; struct in_addr netmask; If a subnet is not spammed struct in_addr loc_addr; for more that 10 secs the time_t l_update; route entry is deleted. } bgpmsg;
  • 14. what's next?!?!??! KNOW ISSUE for v0.1: TODO: * msg are broadcast using ideas? 255.255.255.255 and is not using the effective broadcast address of the passed interface * DELRT show be bogus
  • 15. Use picobgp for redundant gateway HostA has 10.0.1.9 inside it LAN 10.0.1.0/24 and the gws are 10.0.1.1 and 10.0.1.2 We want to setup the route