241 Commits
Author SHA1 Message Date
Satoshi Fujimoto 85a62d8ede peer: Set NeighborAddress before initializing dynamic peers
If State.NeighborAddress is not set, setting default configs
for the dynamic peers will fail. This patch set State.NeighborAddress
before setting default configs.
And this patch avoids overwriting State.NeighborAddress if it is set.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-20 11:28:09 +09:00
Satoshi Fujimoto 1c7829604d peer: Check errors in creating Dynamic Peers
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-20 11:24:05 +09:00
Satoshi Fujimoto d75edf18d7 server: Support Dynamic Neighbor
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-16 15:53:18 +09:00
Satoshi Fujimoto be2524ee3e config: Use State to get NeighborAddress instead of Config
By introducing dynamic neighbor feature,
GoBGP can have dynamic neighbors,
and corresponding Config.NeighboAddress can be empty.

This patch sets State.NeighborAddress for all neighbors,
and gets the neighbor's address from them.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-16 09:09:47 +09:00
FUJITA Tomonori d65df0b045 replace github.com/Sirupsen/logrus with github.com/sirupsen/logrus
The usage of "github.com/sirupsen/logrus" is recommended.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-06-07 21:04:11 +09:00
Satoshi FujimotoandFUJITA Tomonori 6e9d5b56c4 *: Support Peer-Group Configuration
This patch enables to create peer-groups,
also supports dynamic configuration to peer-groups.

Manually set fields in neighbor configs have priority over its peer-group's config,
except some fields, like "peer-as", or "minimum-advertisement-interval" and so on.

Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-05 14:24:45 +09:00
IWASE Yusuke 76ba8fcbda server/peer: Number of filtered routes to advertise
This patch extend the "AdjTable" container to store the number of the
"filtered" routes which should not be advertised to the given neighbor.
This routes mean the filterd routes because of RTC, VRFs, policy and
other constraints.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-05-22 13:12:02 +09:00
Wataru Ishida 9b9a65d410 *: support replace-peer-as (aka as-override)
we use the term replace-peer-as instead of as-override
since openconfig is using it.

cli

```
$ gobgp n add <neighbor-addr> as <asn> replace-peer-as
```

config

```
neighbor:
  config:
    peer-as: <asn>
    neighbor-address: <neighbor-addr>
  as-path-options:
    config:
      replace-peer-as: true
```

Signed-off-by: Wataru Ishida <[email protected]>
2017-05-10 08:15:00 +00:00
Wataru IshidaandFUJITA Tomonori 485b882440 api: fix api/server struct conversion
convert default in/import/export policy type
remove remote-private-as, send-community since we are not using them

Signed-off-by: Wataru Ishida <[email protected]>
2017-05-09 02:52:29 -07:00
FUJITA Tomonori 738c350a67 server: avoid unnecessary path clone with route server
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-27 16:00:54 +09:00
ISHIDA Wataru c8cb20e75b policy: send a withdrawal if export policy blocks an existing route
This patch fixes a bug of export policy and implicit withdrawal.

When a path is filtered by export policy, we need to check whether the
old path (implicit withdrawn path) was sent before the new path.
If it has been sent, we need to send a withdrawal message.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-18 07:40:15 +00:00
ISHIDA WataruandFUJITA Tomonori bba54bdaa1 skip asn negotiation for BGP unnumbered peers
since BGP unnumbered peers are typically trusted, skip asn negotiation
for easy configuration.

from configuration file:

```toml
[[neighbors]]
[[neighbors.config]]
neighbor-interface = "eth0"
```

from cli:

```
$ gobgp neighbor add interface eth0
```

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-04 22:07:46 +09:00
ISHIDA WataruandFUJITA Tomonori 6d55ba613a table: fix bug of UpdatePathAttrs() with ipv6 link-local peer
config.Neighbor.Transport.State.LocalAddress may have zone info and
not be valid ip address format.
Use PeerInfo.LocalAddress instead.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-04 22:07:46 +09:00
ISHIDA WataruandFUJITA Tomonori 3703916e55 server: fix in-policy bug
When a path is rejected by in-policy, the prefix must be withdrawn
since it might already exist in the rib.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-09 14:59:03 +09:00
FUJITA Tomonori e11b09d7ea server: disable advertised number calculation with multiple neighbors
AdjRibOut isn't in memory so needs to be calculated on the fly.

Doing such for multiple neighbors consumes too much CPU (especially
there are lots of routes).

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-18 14:00:51 +09:00
Wataru Ishida 1e22e529c9 config/api: create admin-state type
align with session-state

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:47 +00:00
Wataru Ishida 926ab34220 config: use struct type instead of []byte for capability and open msg
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:35 +00:00
FUJITA Tomonori f610dc4422 server: remove adj-out usage
With this change, we could send unncessary messages but it's harmless
(wastefull though).

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-12 21:22:25 -08:00
FUJITA Tomonori 0ef26666ef table: use old best path instead of withdrawn paths
Preparation for removing in-memory adj-out.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-12 21:21:54 -08:00
Wataru Ishida 4534be2609 server: fix bug of disable/enable/softreset behavior for vrfed neighbor
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-06 07:44:04 +00:00
Wataru IshidaandFUJITA Tomonori a17832195c support neighbor belongs to VRF
$ gobgp vrf add red rd 100:100 rt both 100:100
$ gobgp neighbor add 10.0.0.1 as 2 vrf red
$ gobgp vrf red neighbor
Peer     AS  Up/Down State       |#Advertised Received Accepted
10.0.0.1 2   never   Active      |          0        0        0

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-04 13:19:47 +09:00
Wataru IshidaandFUJITA Tomonori 614746ca11 *: support long lived graceful restart
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-09 07:18:13 -07:00
Wataru Ishida c790472dad server/table: don't modify/delete path attributes for route server client
RFC7947 2.2 says

Optional recognized and unrecognized BGP attributes, whether transitive
or non-transitive, SHOULD NOT be updated by the route server
(unless enforced by local IXP operator configuration) and SHOULD be passed
on to other route server clients

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-16 09:45:24 +00:00
FUJITA Tomonori eef1fc0a75 add RemoteRouterId to config.NeighborState
Stop using config.NeighborState's Description in a hacky way for the
remote Router Id.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-08-26 18:15:03 +09:00
ISHIDA WataruandFUJITA Tomonori b5e49f1319 server: fix advertising multiple local withdrawals with same prefix
a bug introduced by 3327661896

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-08-03 12:09:07 +09:00
FUJITA Tomonori b6e606a994 remove gRPC dependency from peer.go
move gRPC dependency from peer.go to grpc_server.go

Preparation for the removal of gRPC dependency from packages except
for api package.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-07-20 02:52:59 +09:00
FUJITA Tomonori 1f5a66a33c server: replace SenderMsg workaround with InfiniteChannel
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-14 16:49:34 +09:00
FUJITA Tomonori b8f83f8ede drop unknown optional non-transitive attributes
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-06-13 20:41:40 +09:00
ISHIDA WataruandFUJITA Tomonori 70434c96d2 policy: add support setting self ip address as next-hop
from configuration file

[policy-definitions.statements.actions.bgp-actions]
set-next-hop = "self"

from cli

$ gobgp policy statement stmt1 add action next-hop self

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-26 23:19:04 +09:00
ISHIDA Wataru 0dbf1d87cb policy: add local-pref action
$ gobgp policy statement st01 add action local-pref 110

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-25 02:53:42 +00:00
ISHIDA WataruandFUJITA Tomonori a7521827e1 server/table: fix intra-AS RTC route distribution
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori b09e276561 policy: apply export-policy after normal path-attribute updates
fix incomplete 42ab037635

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori a4c2ea3d18 server: improve log message
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
ISHIDA WataruandFUJITA Tomonori 42ab037635 policy: apply export-policy after normal path-attribute updates
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-21 07:45:13 +09:00
ISHIDA WataruandFUJITA Tomonori c7e1f88da3 cli: include route-reflector/route-server infomation in Peer message
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-21 07:45:12 +09:00
FUJITA Tomonori 808331b0f4 docs: add comment for dubious code
[ci skip]

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-10 05:57:39 +09:00
FUJITA Tomonori 58bff63736 fix 3327661896 regression
We can't send a path to a peer if the peer isn't configured for its
family.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-05 23:29:00 +09:00
FUJITA Tomonori 45050d9b97 remove collector mode support
We need to update yang config collector mode (split into config and
state). before that, let's remove the feature itself to see if there
is any user of it.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-25 23:52:21 +09:00
ISHIDA Wataru a34d8d2651 config: simplify config structures
stop generating self-contained leafref fields in openconfig model.
(e.g. bgp:neighbor/bgp:neighbor-address )

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-21 08:57:21 +00:00
ISHIDA Wataru d632d9cdf2 server: support prefix-limit re-configuration via configuration file
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru 56b69b7679 peer: remove redundant config structs
preparation for #597
stop messing up where neighbor configuration is stored
just keep it in each peers' fsm struct

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru efc61d809c server: fix Peer.prefixLimitWarned to adapt with multi-protocol
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 11:12:44 +00:00
ISHIDA Wataru 642270bb32 cli: show prefix-limit configuration by gobgp neighbor <neighbor-addr>
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 06:23:42 +00:00
ISHIDA WataruandFUJITA Tomonori 3327661896 server: send local withdrawal paths regardless of path calculation result
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-19 09:56:41 +09:00
FUJITA Tomonori d670ecd940 peer: prefix-limit calls peer.adjRibIn.Count only if enabled
No need to call peer.adjRibIn.Count() if prefix-limit isn't enabled
(not configured).

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-04-11 23:12:35 +09:00
ISHIDA Wataru 59420a4c46 server: support prefix-limit
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-10 23:58:17 +00:00
ISHIDA WataruandFUJITA Tomonori 0d2633e783 server: serialize in fsm send loop
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-10 00:04:48 +09:00
ISHIDA WataruandFUJITA Tomonori e6682c52ba server: update path-attributes when peer is disconnected
close #807

also add a test to check this issue is fixed

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-03-31 16:36:27 +09:00
FUJITA Tomonori 311324fab8 move packet/*.go to packet/bgp/*.go for Go's convention
Later, we move non-bgp protocol stuff like mrt under their own
direcotries.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-03-31 13:19:17 +09:00
FUJITA Tomonori 0561c11889 server: make rx goroutine reading from socket never sleep
Currently, the rx goroutine reading from socket (recvMessageloop
funciton) sleeps if msgCh is full. The problem is that if the rx
goroutine stops reading from a socket, keepalives are ignored, the
holdtime on gobgp expires even if a peer properly sends keepalives.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-03-07 00:08:04 -08:00