212 Commits
Author SHA1 Message Date
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
IWASE Yusuke 6b710bae42 packet/mrt: BGP with Geo-Location Extensions (RFC6397)
This patch enables to decode/encode MRT format with BGP routing
information including the geographical location which described in
RFC6397.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-06-08 09:28:16 +09:00
Satoshi FujimotoandFUJITA Tomonori 87fe4fa604 cli: Add User Interface for Redirect-IPv6 action
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-05-23 11:11:10 +09:00
IWASE Yusukeandfujita c28f127f5f bgp: Advertise IPv4 routes with IPv6 Next Hop
RFC5549 allows IPv6 Next Hop address for the advertisement of IPv4
related NLRIs for <AFI/SAFI> of <1/1>, <1/2>, <1/4> and <1/128>.
Currently, the advertisement using the MP_REACH_NLRI is supported,
but IPv4 routes with IPv6 Next Hop is not enough.

This patch enable to advertise IPv4 routes for <AFI/SAFI> of <1/1>
through GoBGP CLI command.
e.g.)
  $ gobgp global rib add -a ipv4 10.2.1.0/24 nexthop 2001:2::1

Signed-off-by: IWASE Yusuke <[email protected]>
2017-05-15 15:14:24 +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 Ishida 1f053c25c4 *: support remove private as
cli

```
$ gobgp n add <neighbor-addr> as <asn> remove-private-as (all|replace)
```

config

```
neighbor:
  config:
    peer-as: <asn>
    neighbor-address: <neighbor-addr>
    remove-private-as: all
```

Signed-off-by: Wataru Ishida <[email protected]>
2017-05-10 08:05:47 +00:00
ISHIDA Wataru 0f62519cd7 server: ignore routes when local AS is in AS_PATH
RFC4271 9.1.2 Phase 2: Route Selection

If the AS_PATH attribute of a BGP route contains an AS loop, the BGP
route should be excluded from the Phase 2 decision function.  AS loop
detection is done by scanning the full AS path (as specified in the
AS_PATH attribute), and checking that the autonomous system number of
the local system does not appear in the AS path.  Operations of a BGP
speaker that is configured to accept routes with its own autonomous
system number in the AS path are outside the scope of this document.

Also this commit adds support for allow-own-as option to relax this.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-05-09 11:10:45 -04:00
Wataru Ishida 86d9587f75 cli: speed up showing a specific defined-set
Signed-off-by: Wataru Ishida <[email protected]>
2017-05-06 09:30:10 -04:00
FUJITA Tomonori aa5a115012 table: avoid cloning path for withdraw
when a peer having lots of routes goes down, the cloning paths consume
too much memory.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-27 16:00:54 +09:00
Daniel PortellaandGitHub 924f55ed2a Update neighbor.go 2017-04-21 14:21:05 +01:00
FUJITA Tomonori ae7e572550 cmd: fix neighbor get with the interface name
fix the regression of commit 7fc7956946

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-21 01:09:10 -07:00
Wataru IshidaandFUJITA Tomonori d87960be70 cli: tls support 2017-04-17 22:28:24 +09:00
kishiguroandFUJITA Tomonori 70e12e0869 "gobgp neighbor NEIGHBOR" output shows local capabiity as remote one. 2017-04-17 22:23:34 +09: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 00f8406cb6 packet/bgp: add extended-nexthop capability
Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-04 22:07:46 +09:00
Wataru IshidaandFUJITA Tomonori f8b9b0a7ed cli: don't calculate # of advertised routes when not necessary
Signed-off-by: Wataru Ishida <[email protected]>
2017-04-02 14:17:14 +09:00
IWASE Yusuke c06423e60b cli: Enable to get nexthop reachability state
This patch enables GoBGP CLI to get the best path based on the nexthop
reachability state.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-06 11:11:54 +09:00
Matthieu TexierandFUJITA Tomonori 55e9684259 flowspec: comply with new draft RFC5575bis normalized operators 2017-03-02 15:56:02 +09:00
ISHIDA Wataru ba75b73869 cli: return error with invalid input
before:
$ gobgp n 10.0.0.1 adj-in foo
Network not in table

after:
$ gobgp n 10.0.0.1 adj-in foo
invalid CIDR/IP

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-22 06:00:05 +00:00
Matthieu TexierandFUJITA Tomonori 6de16dc885 flowspec: comply with RFC 5575 about TCP flags rules
This patch proposes a new way to configure BGP flowspec TCP flags
rules It allows to comply with RFC 5575 by defining flags like this
=SA =A / '!SA' / '=SA&=!U' = means match, ! means not, & means and,
all TCP flags are identified by their first charater S for SYN A for
Ack ...
2017-02-17 21:20:59 +09:00
ISHIDA WataruandFUJITA Tomonori 9a45ed09b0 cli: add current option to monitor commands
Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-15 00:10:15 +09:00
IWASE YusukeandFUJITA Tomonori 64360afd45 cli: Administrative Shutdown Communication on disable neighbor
This patch adds "--reason" option support into the disable neighbor command
which can specify "Administrative Shutdown Communication" on the BGP Cease
NOTIFICATION message.

Usage:
  $ gobgp neighbor <neighbor address> disable --reason "some messages"

Signed-off-by: IWASE Yusuke <[email protected]>
2017-02-03 22:47:34 -08:00
IWASE YusukeandFUJITA Tomonori 1063bcab1e cli: Communication on Administrative Shutdown NOTIFICATION
This patch enable to send an arbitrary message on the Cease NOTIFICATION
message with "Administrative Shutdown" and "Administrative Reset" subcodes
with "--reason" option.

Usage:
  $ gobgp neighbor <neighbor address> shutdown --reason "some messages"
  $ gobgp neighbor <neighbor address> reset --reason "some messages"

Reference: https://tools.ietf.org/html/draft-ietf-idr-shutdown-04

Signed-off-by: IWASE Yusuke <[email protected]>
2017-02-03 22:47:34 -08:00
ISHIDA WataruandFUJITA Tomonori fe486d84e3 server: check server is up before admin operation
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-11-06 02:36:22 +09:00
Wataru IshidaandFUJITA Tomonori d44f6915ca cli: fix bug of injecting mrt table dump v2 data
a bug introduced by c4ced97e76

Signed-off-by: Wataru Ishida <[email protected]>
2017-01-15 06:41:36 -08:00
Hiroshi YokoiandFUJITA Tomonori 19b2a6cf51 cli: fix policy formatting bug 2016-12-15 13:06:24 +09:00
Chris StocktonandFUJITA Tomonori 296ffdba9a client: rename client.GoBGPClient to client.Client 2016-12-10 05:44:43 -08:00
Chris StocktonandFUJITA Tomonori 7eadc1c1c9 client: Allow creating a GoBGPClient using a user specific GRPC connection and client
This allows wrapping the dialer, implementing your own wrapped
GobgpApiClient or dialing with a context for cancelation on unreliable
endpoints.
2016-12-05 01:21:31 -08: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 93d1dca70a config: simplify route-disposition configuration
before:

```yaml
actions:
    route-disposition:
        accept-route: true
        reject-route: false
```

after

```yaml
action:
    router-disposition: accept-route
```

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-17 23:22:55 -05:00
Wataru Ishida 24e397b0f6 add go vet test
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-17 21:52:20 -05:00
Wataru Ishida a3e262f3a8 cli: fix another formatting bug
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-16 09:58:27 -05:00
Wataru Ishida e6f109a72c cli: fix neighbor formatting
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-16 09:20:32 -05:00
Wataru Ishida ee8ce99e2d client: support neighbor filtering
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:48 +00: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 c4ced97e76 cli: use client library
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:46 +00:00
Wataru Ishida 3f2dd34d37 client: add golang client library
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:45 +00:00
Wataru IshidaandFUJITA Tomonori 17f7cc4a44 cli: deprecate neighbor shutdown command
Since `shutdown` command just sends ADMINISTRATIVE_SHUTDOWN notification
and doesn't change admin-state, neighbors can be get established after
idle-holdtime which is not intuitive from the name of the API.

We can use `reset` command to hard-reset BGP session, and `disable` command
to shutdown(disable) BGP session.

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-04 13:20:06 +09:00
Wataru IshidaandFUJITA Tomonori 4bdaf1e64c cli: support adding rr-client and rs-client
$ gobgp neighbor add 10.0.0.1 route-reflector-client
$ gobgp neighbor add 10.0.0.1 route-reflector-client 1.1.1.1
$ gobgp neighbor add 10.0.0.1 route-server-client

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-04 13:20:03 +09: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
FUJITA Tomonori be9918a163 remove label allocation completely
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-03 02:49:59 -07:00
FUJITA Tomonori c7653aa9d4 allow add local route with specific mpls label
Also don't allocate label for local routes. The label management needs
to work with other components rather than bgp.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-03 02:49:59 -07:00
Wataru Ishida 1f4a3192af cli/api: support getting table summary information
$ gobgp global rib summary -a ipv4
$ gobgp neighbor 10.0.0.1 local summary
$ gobgp neighbor 10.0.0.1 adj-in summary
$ gobgp neighbor 10.0.0.1 adj-out summary

Signed-off-by: Wataru Ishida <[email protected]>
2016-10-16 14:07:06 +00:00
Wataru Ishida d46da74d4f policy: support large-community match/action
close #1133

Signed-off-by: Wataru Ishida <[email protected]>
2016-10-10 05:18:17 +00: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 7c8b1973e7 cli: support specifying vrf-id when creating vrf
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-04 05:04:26 +00:00
Wataru Ishida 8821d5c33b cli: add description to PeerConf struct
Signed-off-by: Wataru Ishida <[email protected]>
2016-09-25 07:28:18 +00:00
Wataru IshidaandFUJITA Tomonori 0db1cd4af2 bgp/cli: support evpn route type 5 (ip prefix advertisement)
see draft-ietf-bess-evpn-prefix-advertisement-03

$ gobgp g ri -a evpn add prefix 10.0.0.0/24 etag 20 rd 100:100 rt 100:100 gw 10.10.10.10 label 100
$ gobgp g ri -a evpn add prefix 200::/64 etag 20 rd 100:100 rt 100:100 gw 200::1 label 10000

close #1082

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-15 14:32:34 -07:00
Wataru IshidaandFUJITA Tomonori a3ccd8e86b bgp/cli: Support Large Community
see https://tools.ietf.org/html/draft-heitz-idr-large-community-04

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-14 11:35:50 +09:00
Wataru IshidaandFUJITA Tomonori 6eb19da965 bgp: support latest Opaque Signaling draft
see https://tools.ietf.org/html/draft-lapukhov-bgp-opaque-signaling-02

$ gobgp global rib -a opaque add key hello value world
$ gobgp global rib -a opaque del key hello

Signed-off-by: Wataru Ishida <[email protected]>
2016-09-14 11:35:50 +09:00