root@ubuntu:/home/guoyi/frr/frr# systemctl status frr ● frr.service - FRRouting Loaded: loaded (/etc/systemd/system/frr.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-10-1605:46:16 PDT; 1s ago Docs: https://frrouting.readthedocs.io/en/latest/setup.html Process: 55748 ExecStart=/usr/lib/frr/frrinit.sh start (code=exited, status=0/SUCCESS) Main PID: 55760 (watchfrr) Status: "FRR Operational" Tasks: 8 (limit: 4540) Memory: 14.5M CGroup: /system.slice/frr.service ├─55760 /usr/lib/frr/watchfrr -d-F traditional zebra mgmtd staticd ├─55771 /usr/lib/frr/zebra -d-F traditional -A127.0.0.1-s90000000 ├─55776 /usr/lib/frr/mgmtd -d-F traditional -A127.0.0.1 └─55778 /usr/lib/frr/staticd -d-F traditional -A127.0.0.1
Oct 1605:46:16 ubuntu zebra[55771]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00 Oct 1605:46:16 ubuntu mgmtd[55776]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00 Oct 1605:46:16 ubuntu watchfrr[55760]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00 Oct 1605:46:16 ubuntu staticd[55778]: [VTVCM-Y2NW3] Configuration Read in Took: 00:00:00 Oct 1605:46:16 ubuntu watchfrr[55760]: [QDG3Y-BY5TN] zebra state -> up : connect succeeded Oct 1605:46:16 ubuntu watchfrr[55760]: [QDG3Y-BY5TN] mgmtd state -> up : connect succeeded Oct 1605:46:16 ubuntu watchfrr[55760]: [QDG3Y-BY5TN] staticd state -> up : connect succeeded Oct 1605:46:16 ubuntu watchfrr[55760]: [KWE5Q-QNGFC] all daemons up, doing startup-complete notify Oct 1605:46:16 ubuntu frrinit.sh[55748]: * Started watchfrr Oct 1605:46:16 ubuntu systemd[1]: Started FRRouting.
安装问题
启动 frr 时报错
1 2 3 4
Oct 15 09:02:45 ubuntu systemd[1]: Starting FRRouting... Oct 15 09:02:45 ubuntu frrinit.sh[28693]: * Starting watchfrr with command: ' /usr/lib/frr/watchfrr -d -F traditional zebra mgmtd staticd' Oct 15 09:02:45 ubuntu frrinit.sh[28703]: /usr/lib/frr/watchfrr: error while loading shared libraries: libyang.so.2: cannot open shared object file: No such file or directory Oct 15 09:02:45 ubuntu frrinit.sh[28693]: * Failed to start watchfrr!
# This file tells the frr package which daemons to start. # # Sample configurations for these daemons can be found in # /usr/share/doc/frr/examples/. # # ATTENTION: # # When activating a daemon for the first time, a config file, even if it is # empty, has to be present *and* be owned by the user and group "frr", else # the daemon will not be started by /etc/init.d/frr. The permissions should # be u=rw,g=r,o=. # When using "vtysh" such a config file is also needed. It should be owned by # group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too. # # The watchfrr, zebra and staticd daemons are always started. # bgpd=no ospfd=yes ospf6d=no ripd=no ripngd=no isisd=no pimd=no pim6d=no ldpd=no nhrpd=no eigrpd=no babeld=no sharpd=no pbrd=no bfdd=no fabricd=no vrrpd=no pathd=no
# # If this option is set the /etc/init.d/frr script automatically loads # the config via "vtysh -b" when the servers are started. # Check /etc/pam.d/frr if you intend to use "vtysh"! # vtysh_enable=yes zebra_options=" -A 127.0.0.1 -s 90000000" mgmtd_options=" -A 127.0.0.1" bgpd_options=" -A 127.0.0.1" ospfd_options=" -A 127.0.0.1" ospf6d_options=" -A ::1" ripd_options=" -A 127.0.0.1" ripngd_options=" -A ::1" isisd_options=" -A 127.0.0.1" pimd_options=" -A 127.0.0.1" pim6d_options=" -A ::1" ldpd_options=" -A 127.0.0.1" nhrpd_options=" -A 127.0.0.1" eigrpd_options=" -A 127.0.0.1" babeld_options=" -A 127.0.0.1" sharpd_options=" -A 127.0.0.1" pbrd_options=" -A 127.0.0.1" staticd_options="-A 127.0.0.1" bfdd_options=" -A 127.0.0.1" fabricd_options="-A 127.0.0.1" vrrpd_options=" -A 127.0.0.1" pathd_options=" -A 127.0.0.1"
# If you want to pass a common option to all daemons, you can use the # "frr_global_options" variable. # #frr_global_options=""
# The list of daemons to watch is automatically generated by the init script. # This variable can be used to pass options to watchfrr that will be passed # prior to the daemon list. # # To make watchfrr create/join the specified netns, add the the "--netns" # option here. It will only have an effect in /etc/frr/<somename>/daemons, and # you need to start FRR with "/usr/lib/frr/frrinit.sh start <somename>". # #watchfrr_options=""
# This is the maximum number of FD's that will be available. Upon startup this # is read by the control files and ulimit is called. Uncomment and use a # reasonable value for your setup if you are expecting a large number of peers # in say BGP. # #MAX_FDS=1024
# Uncomment this option if you want to run FRR as a non-root user. Note that # you should know what you are doing since most of the daemons need root # to work. This could be useful if you want to run FRR in a container # for instance. # FRR_NO_ROOT="yes"
# For any daemon, you can specify a "wrap" command to start instead of starting # the daemon directly. This will simply be prepended to the daemon invocation. # These variables have the form daemon_wrap, where 'daemon' is the name of the # daemon (the same pattern as the daemon_options variables). # # Note that when daemons are started, they are told to daemonize with the `-d` # option. This has several implications. For one, the init script expects that # when it invokes a daemon, the invocation returns immediately. If you add a # wrap command here, it must comply with this expectation and daemonize as # well, or the init script will never return. Furthermore, because daemons are # themselves daemonized with -d, you must ensure that your wrapper command is # capable of following child processes after a fork() if you need it to do so. # # If your desired wrapper does not support daemonization, you can wrap it with # a utility program that daemonizes programs, such as 'daemonize'. An example # of this might look like: # # bgpd_wrap="/usr/bin/daemonize /usr/bin/mywrapper" # # This is particularly useful for programs which record processes but lack # daemonization options, such as perf and rr. # # If you wish to wrap all daemons in the same way, you may set the "all_wrap" # variable. # #all_wrap=""
docker run -d --privileged --net=none --name frr-01 quay.io/frrouting/frr:10.0.0 docker run -d --privileged --net=none --name frr-02 quay.io/frrouting/frr:10.0.0 docker run -d --privileged --net=none --name frr-03 quay.io/frrouting/frr:10.0.0
查看 docker 进程
1 2 3 4 5
root@ubuntu:~# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6185c04f06d1 quay.io/frrouting/frr:10.0.0"/sbin/tini -- /usr/…"2 minutes ago Up 2 minutes frr-03 1681fd9bd374 quay.io/frrouting/frr:10.0.0"/sbin/tini -- /usr/…"3 minutes ago Up 3 minutes frr-02 568ade633bf9 quay.io/frrouting/frr:10.0.0"/sbin/tini -- /usr/…"24 hours ago Up 24 hours frr-01
root@ubuntu:~# ovs-vsctl show cb63c817-8d63-4d1f-b599-9950b0aeb2eb Bridge brConn Port brConn Interface brConn type: internal Port "0021a5f25d344_l" Interface "0021a5f25d344_l" Port "1529171a9a294_l" Interface "1529171a9a294_l" Port df2bf7ec96bd4_l Interface df2bf7ec96bd4_l Port a67433ae00b04_l Interface a67433ae00b04_l ovs_version: "2.13.8"