Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are attempting to setup a Gentoo Linux box to run a Quagga BGP router for our internet connection. We've tried many things, but everything we've tried results in Quagga reporting that there is no BGP network available and it never connects to the neighbor router. I think a fresh start is going to be our best bet, so our question is:

What configuration would we need to use (bgpd.conf/zebra.conf) to get the following setup working:
(please note: I just chose a couple random Google IP ranges, these are not the real IP addresses)

  • Router IP: 74.125.53.103/29
  • Router AS: 9283
  • Public IP Range: 209.85.171.0/24 (these are the public IP addresses we use which run through the router listed above)
  • Neighbor IP: 74.125.53.104/29
  • Neighbor AS: 9283

We currently have this setup and running through a Linksys home router running the DD-WRT firmware. It works like a champ, but the load is beginning to be too much for it. We've considered several options for routers and for various reasons I won't go into, running our own custom built router seems to be the favored choice.

Thank you in advance for your help, we've been pulling our hair out trying to figure this out!

share|improve this question
    
Last time I checked BGP routing tables for the internet weighted something like 300MB which your Linksys clearly does not have. BGP is a very critical part of a network, you really shouldn't be going cheap here... –  Antoine Benkemoun Jun 3 '09 at 6:24
    
Your router and your neighbour have the same AS number. I'm not sure this is what you want. Also, unless APNIC's whois isn't being very useful, that AS doesn't look assigned. –  David Pashley Jun 3 '09 at 6:45
    
Looks like APNIC's whois isn't returning useful results: robtex.com/as/as9283.html –  David Pashley Jun 3 '09 at 6:47
1  
Do you have your own AS number? If not you're not going to be able to use BGP (unless you persuade your ISP to set up a private AS number for use solely with them). –  Whisk Jun 3 '09 at 7:15
    
Can you explain what your requirement for BGP is? Are you multi-homing? –  Dan Carley Jun 3 '09 at 8:30
add comment

5 Answers

up vote 3 down vote accepted

Here's another example, with basic filtering (no RFC1918 inbound routes, only advertise your local prefix:

router bgp YOURASN
 bgp router-id BGP_ROUTER_IP_ADDRESS
 network 209.85.171.0/24
 neighbor myisp peer-group
 neighbor myisp remote-as ISPASN
 neighbor myisp distribute-list 3 in
 neighbor myisp distribute-list 4 out
 neighbor myisp filter-list 2 out
 neighbor ISP_ROUTER_IP_ADDRESS peer-group myisp
 distance bgp 150 150 150
!
access-list 3 deny 10.0.0.0 0.0.0.255
access-list 3 deny 192.168.0.0 0.0.255.255
access-list 3 deny 172.16.0.0 0.15.255.255
access-list 3 permit any
access-list 4 permit 209.85.171.0 0.0.0.255
!
ip as-path access-list 2 permit ^$
share|improve this answer
add comment

This is the probable minimun you require within your bgpd.conf.

router bgp YOURASN
bgp router-id 74.125.53.103
  network 209.85.171.0/24
  neighbor 74.125.53.104 remote-as ISPASN

It isn't pretty and you really should add some prefix lists etc before you start looking at adding multiple upstreams just so you don't accidently advertise the entire global table between two ISPs. That being said, if the gentoo box is only being used as a router and nothing else go get a copy of vyatta community edition and use that instead.

share|improve this answer
add comment

I've been working on publishing some articles on Anycast DNS using Quagga, so I am fairly familiar with it. The article I am currently working on was OSPF, and one of the gotchas that i experienced was that my Quagga Box was NOT seeing OSPF adjacencies or upstream routers. I had to add firewall rules to IPtables to allow OSPF protocol to work. Are you sure you have the right firewall rule(s) in place for bgp peering to happen? I think it's TCP port 179 for BGP...

A nice article http://netup.biz/BGP_Cisco_Gentoo_Linux_Quagga.php

share|improve this answer
add comment

If both routers have the same AS you'll be doing iBGP and so won't be exchanging all routes, only best routes, and things won't behave as you expect if in fact the different routers aren't part of the same interior network / autonomous system.

share|improve this answer
add comment

There's a sample BGP configuration generator at http://www.oriontechnologysolutions.com/administration/basic-bgp-config-generator/ Fill out the form and it gives you this:

!
router bgp 9283
bgp router-id 74.125.53.103
bgp log-neighbor-changes
network 209.85.171.0/24
!
# Begin configuration for Peer 1
neighbor 74.125.53.104 remote-as 9283
neighbor 74.125.53.104 soft-reconfiguration inbound
neighbor 74.125.53.104 description Peer 1
neighbor 74.125.53.104 next-hop-self
!

Please note, you used the same AS for your network and the upstream network in your example. This is not really a common configuration because normally your ISP is one AS, and you have another. This configuration is a more common scenario.

!
router bgp 9283
bgp router-id 74.125.53.103
bgp log-neighbor-changes
network 209.85.171.0/24
!
# Begin configuration for Peer 1
neighbor 74.125.53.104 remote-as 9281
neighbor 74.125.53.104 soft-reconfiguration inbound
neighbor 74.125.53.104 description Peer 1
neighbor 74.125.53.104 route-map rm_peer_1_in in
neighbor 74.125.53.104 route-map rm_peer_1_out out
!
ip prefix-list pl_peer_1_out seq 5 permit 209.85.171.0/24
!
route-map rm_peer_1_out permit 5
 match ip address prefix-list pl_peer_1_out
 set as-path prepend 9283
!
route-map rm_peer_1_in permit 5
 # Adjust this to favor some peers over others.
 # Higher number is more preferred
 # 0 - 255 with 100 being the default
 set local-preference 100
!

Please note in both cases, I did pull configuration information from peer 2 as that's not really required for what you're doing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.