summaryrefslogtreecommitdiffstats
path: root/vtysh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vtysh: remove exit-vrf for vtysh -mQuentin Young2018-04-171-2/+0
| | | | | | | | | | | | | | | | | | | | How It's Made: - vtysh -m is for frr-reload.py to know when a context ends. This is done by executing commands against the CLI graph, checking for walkup, and putting the appropriate context exit if walkup is necessary. Thus the default case for walking up from a vrf context is fine, and doesn't need a specific exit-vrf command. Remove that. - exit-vrf needs to be explicitly printed at the end of vrf config printing. We already do this. - vtysh's special snowflake config prettiness logic needs to know that exit-vrf goes with the vrf block and needs to be explicitly told not place this in alphabetical order in that block. We also already do this. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vtysh, zebra: print exit-vrf at end of vrf contextQuentin Young2018-04-172-1/+7
| | | | | | | Need to explicitly exit this context otherwise we risk ambiguities between global and vrf context commands Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vtysh: fix pathspec option -NChristian Franke2018-04-111-2/+8
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* Merge pull request #1903 from donaldsharp/PBRDRuss White2018-04-115-18/+112
|\ | | | | Pbrd
| * pbrd: Add PBR to FRRDonald Sharp2018-04-065-18/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an implementation of PBR for FRR. This implemenation uses a combination of rules and tables to determine how packets will flow. PBR introduces a new concept of 'nexthop-groups' to specify a group of nexthops that will be used for ecmp. Nexthop-groups are specified on the cli via: nexthop-group DONNA nexthop 192.168.208.1 nexthop 192.168.209.1 nexthop 192.168.210.1 ! PBR sees the nexthop-group and installs these as a default route with these nexthops starting at table 10000 robot# show pbr nexthop-groups Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1 Valid: 1 nexthop 192.168.209.1 Valid: 1 nexthop 192.168.210.1 Valid: 1 nexthop 192.168.208.1 I have also introduced the ability to specify a table in a 'show ip route table XXX' to see the specified tables. robot# show ip route table 10001 Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, > - selected route, * - FIB route F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25 * via 192.168.209.1, enp0s9, 00:14:25 * via 192.168.210.1, enp0s10, 00:14:25 PBR tracks PBR-MAPS via the pbr-map command: ! pbr-map EVA seq 10 match src-ip 4.3.4.0/24 set nexthop-group DONNA ! pbr-map EVA seq 20 match dst-ip 4.3.5.0/24 set nexthop-group DONNA ! pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>' to affect decisions about incoming packets. Additionally if you only have one nexthop to use for a pbr-map you do not need to setup a nexthop-group and can specify 'set nexthop XXXX'. To apply the pbr-map to an incoming interface you do this: interface enp0s10 pbr-policy EVA ! When a pbr-map is applied to interfaces it can be installed into the kernel as a rule: [sharpd@robot frr1]$ ip rule show 0: from all lookup local 309: from 4.3.4.0/24 iif enp0s10 lookup 10001 319: from all to 4.3.5.0/24 iif enp0s10 lookup 10001 1000: from all lookup [l3mdev-table] 32766: from all lookup main 32767: from all lookup default [sharpd@robot frr1]$ ip route show table 10001 default proto pbr metric 20 nexthop via 192.168.208.1 dev enp0s8 weight 1 nexthop via 192.168.209.1 dev enp0s9 weight 1 nexthop via 192.168.210.1 dev enp0s10 weight 1 The linux kernel now will use the rules and tables to properly apply these policies. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #1982 from qlyoung/fixup-vtysh-readJafar Al-Gharaibeh2018-04-101-34/+59
|\ \ | |/ |/| vtysh: fixup incorrect read logic
| * vtysh: fixup incorrect read logicQuentin Young2018-04-041-34/+59
| | | | | | | | | | | | | | | | | | | | If a daemon sent vtysh a response whose size satisfied 1 <= 4096 - (size % 4096) <= 2 vtysh would hang. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #1998 from qlyoung/fix-vrf-keyword-walkupRuss White2018-04-051-1/+15
|\ \ | |/ |/| lib, vtysh: vrf walkup bugfix
| * lib, vtysh: vrf walkup bugfixQuentin Young2018-03-301-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Static route commands are now installed inside the VRF nodes. This has quietly broken top-level static routes in certain scenarios due to walkup logic resolving a static route configuration command inside VRF_NODE first if the command is issued while in a CLI node lower than VRF_NODE. To fix this VRF_NODE needs a special exit command, as has been done for many other nodes with the same issue, to explicitly change the vrf context to the default VRF so that when walkup resolves against the VRF node it will configure against the default VRF as desired. Of course this is a hack on top of a hack and the CLI walkup implementation needs to be rewritten. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #1894 from LabNConsulting/working/master/vtysh-not-enabledQuentin Young2018-04-033-9/+31
|\ \ | | | | | | vtysh: add -u/--user flag to run commands without enable
| * | vtysh: move user_mode to header file, keep checkpatch happyLou Berger2018-03-283-3/+7
| | | | | | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
| * | vtysh: add -u/--user flag to run commands without enableLou Berger2018-03-282-9/+27
| |/ | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | bgpd: `logical-router` netns vtysh configuration comparison incorrectPhilippe Guibert2018-04-031-1/+1
| | | | | | | | | | | | `logical-router` netns vtysh configuration comparison incorrect Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #2005 from qlyoung/remove-masc-nodeRafael Zalamena2018-04-021-1/+0
|\ \ | | | | | | lib: remove MASC_NODE
| * | lib: remove MASC_NODEQuentin Young2018-03-301-1/+0
| | | | | | | | | | | | | | | | | | Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | | lib: remove SERVICE_NODEQuentin Young2018-03-301-5/+3
|/ / | | | | | | | | | | Unused Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | Merge pull request #1978 from qlyoung/fix-debug-all-vtysh-nodeRuss White2018-03-301-1/+1
|\ \ | | | | | | vtysh: fix node install of `[no] debug all`
| * | vtysh: fix node install of `[no] debug all`Quentin Young2018-03-281-1/+1
| |/ | | | | | | | | | | Command belongs in ENABLE_NODE, not VIEW_NODE. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* / vtysh: add flowspec address family cmd supportPhilippe Guibert2018-03-301-1/+47
|/ | | | | | add flowspec v4 and flowspec v6 address family support for BGP. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-273-10/+10
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* watchfrr, vtysh: do not write config during crashQuentin Young2018-03-211-1/+6
| | | | | | | | | | | | | | | | | If a daemon is restarting, crashed, or otherwise in the process of reconnecting to watchfrr and a user issues "write memory" or "write file" the resulting config will not include the configuration of that daemon. This is problematic because this output will overwrite the previous config, potentially causing unintentional loss of configuration stored only in the config file based upon timing. This patch remedies that by making watchfrr check that all daemons are up before attempting a configuration write, and updating vtysh so that its failsafe respects this condition as well. Note that this issue only manifests when using integrated config. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* bgpd: new vpn-policy CLIG. Paul Ziemba2018-03-201-37/+2
| | | | | | | | | | | | | | | | | | | | | PR #1739 added code to leak routes between (default VRF) VPN safi and unicast RIBs in any VRF. That set of changes included temporary CLI including vpn-policy blocks to specify RD/RT/label/&c. After considerable discussion, we arrived at a consensus CLI shown below. The code of this PR implements the vpn-specific parts of this syntax: router bgp <as> [vrf <FOO>] address-family <afi> unicast rd (vpn|evpn) export (AS:NN | IP:nn) label (vpn|evpn) export (0..1048575) rt (vpn|evpn) (import|export|both) RTLIST... nexthop vpn (import|export) (A.B.C.D | X:X::X:X) route-map (vpn|evpn|vrf NAME) (import|export) MAP [no] import|export [vpn|evpn|evpn8] [no] import|export vrf NAME User documentation of the vpn-specific parts of the above syntax is in PR #1937 Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* Merge branch 'master' into working/master/bgp-vpn-vrf-leakingpaulzlabn2018-03-141-8/+20
|\
| * vtysh: restore some DEFUNs that should not have been reformated by indent.pyLou Berger2018-03-131-11/+20
| |
* | vtysh: add bgpd vpn-policy nodesG. Paul Ziemba2018-03-091-5/+37
|/ | | | Signed-off-by: G. Paul Ziemba <paulz@labn.net>
* lib, vtysh: Start cli for nexthop-groupDonald Sharp2018-03-091-0/+1
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1808 from qlyoung/debug-mt-safeRenato Westphal2018-03-091-2/+16
|\ | | | | MT-safe debug facilities
| * lib: add mt-safe debugging facilitiesQuentin Young2018-03-011-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current strategy for fine-grained debugging across FRR is to use static long int bitfields, in combination with helper macros that are copy-pasted between daemons, to hold state on what debugging information should be collected at any given time. This has a couple of problems: * These bitfields are generally extern'd and accessed everywhere, so they are not MT-safe or easy to make MT-safe * Lots of code duplication from copy-pasting the DEBUG_* macros... * Code duplication because of the "term" vs "conf" debugging concept This patch aims to remedy that by providing some infrastructure to work with debugs. The core concept of using bitfields has been retained, but the number of these for each debug has been reduced to 1. This allows easy use of lock-free methods for synchronizing access to debugging info. The helper macros have also been retained but they are now collected in one place and perform exclusively atomic operations. Finally there is a bit of code that allows daemons to register callbacks, which I used to implement a command that will toggle all debugging for any daemons that use these facilities. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-064-48/+29
| | | | | | | | Signed-off-by: Lou Berger <lberger@labn.net>
* | Merge pull request #1833 from opensourcerouting/fix-vtysh-output-initQuentin Young2018-03-062-2/+2
|\ \ | | | | | | vtysh: initialize vty structure correctly for output to terminal
| * | vtysh: initialize vty structure correctly for output to terminalChristian Franke2018-03-062-2/+2
| |/ | | | | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* | Merge pull request #1728 from mkanjari/evpn-bug-fixesPhilippe Guibert2018-03-061-0/+5
|\ \ | |/ |/| Evpn bug fixes
| * Merge branch 'master' into evpn-bug-fixesMitesh Kanjariya2018-02-272-1/+15
| |\
| * | vtysh/lib: write domainname to config fileMitesh Kanjariya2018-02-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Ticket: CM-19626 Review: CCR-7170 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
* | | vtysh: Fix missing \n at end of desc stringChristian Franke2018-02-271-1/+1
| | |
* | | vtysh: pass route-map & prefix-list commands to isisd and sharpdChristian Franke2018-02-272-4/+4
| | | | | | | | | | | | | | | Use VTYSH_RMAP in extract.pl instead of having two lists, and add isisd and sharpd to VTYSH_RMAP.
* | | vtysh: change logical router node namePhilippe Guibert2018-02-274-16/+33
| |/ |/| | | | | | | | | | | The logical router node goes from NS_NODE to LOGICALROUTER_NODE. Vty commands are renamed accordingly. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | vtysh: .history_quagga --> .history_frrQuentin Young2018-02-231-1/+1
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | pimd: Multicast traceroute client and routerMladen Sablic2018-02-191-0/+14
|/ | | | | | | | This commit is the implementation of weak multicast traceroute. It consists of IGMP module dealing with mtrace type IGMP messages and client program mtrace/mtracebis for initiating mtrace queries. Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
* Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancementsPhilippe Guibert2018-02-081-3/+5
|\ | | | | Evpn symmetric routing enhancements
| * lib: Display configured VRFsvivek2018-01-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Ensure that configured VRFs are displayed in the running configuration. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Mitesh Kanjariya <mkanjariya@cumulusnetworks.com> Ticket: CM-10139 Reviewed By: CCR-7012 Testing Done: Verify failed test scenario
* | Merge pull request #1653 from Orange-OpenSource/SR-RoutingDonald Sharp2018-02-061-0/+1
|\ \ | | | | | | OSPFD: Add Experimental Segment Routing support
| * | Merge remote-tracking 'frr/master' into SR-RoutingOlivier Dugeon2018-01-303-52/+116
| |\|
| * | OSPFD: Add Experimental Segment Routing supportOlivier Dugeon2018-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an implementation of draft-ietf-ospf-segment-routing-extensions-24 and RFC7684 for Extended Link & Prefix Opaque LSA. Look to doc/OSPF_SR.rst for implementation details & known limitations. New files: - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB) - ospfd/ospf_sr.c: Main functions for Segment Routing support - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation - doc/OSPF-SRr.rst: Documentation Modified Files: - doc/ospfd.texi: Add new Segment Routing CLI command definition - lib/command.h: Add new string command for Segment Routing CLI - lib/mpls.h: Add default value for SRGB - lib/route_types.txt: Add new OSPF Segment Routing route type - ospfd/ospf_dump.[c,h]: Add OSPF SR debug - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c() - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger update of NHLFE - ospfd/ospfd.h: Add new thread for Segment Routing scheduler - ospfd/subdir.am: Add new files - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh - zebra/kernel_netlink.c: Add new OSPF_SR route type - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type - zebra/zebra_mpls.h: Add new OSPF_SR route type Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | | *: silence '-Wchar-subscripts' warnings on NetBSDRenato Westphal2018-02-021-2/+2
| |/ |/| | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #1634 from qlyoung/vtysh-output-fileRuss White2018-01-163-45/+93
|\ \ | | | | | | vtysh: add ability to output to file
| * | vtysh: add ability to output to fileQuentin Young2018-01-123-45/+93
| |/ | | | | | | | | | | | | | | Add ability to set file destination for all vtysh output, with the exception of tab-complete and similar meta output. This is useful for inline recording of some information without exiting the shell. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* / vtysh: optimize printout routineQuentin Young2018-01-081-7/+23
|/ | | | | | | | | | | | | | | | | | When printing responses from a client, vtysh searches through every response it receives twice. Once is to look for the terminating sequence and the other is to translate \n to \0, which is used with the line processing callback capability. However: * There's no need to search all of the output for the terminator, we can just check the last 4 bytes. * In most scenarios we won't have a callback. Therefore we don't need to process the output and can just dump it. Together these optimizations have a significant impact on the total runtime of talkative CLI commands, such as `sh ip bgp json` which runs roughly 1000% faster when dumping 1,000,000 routes. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #1445 from donaldsharp/rpki_vtyshRenato Westphal2017-11-281-0/+8
|\ | | | | vtysh: If RPKI is not compiled in don't let vtysh think it is.
| * vtysh: If RPKI is not compiled in don't let vtysh think it is.Donald Sharp2017-11-141-0/+8
| | | | | | | | | | | | | | | | The RPKI code can be turned on/off via configure switches. If we have intentionally turned it off do not let vtysh display that you can config it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>