git clone https://github.com/mwarning/docker-openwrt-builder.git cd docker-openwrt-builder docker build -t openwrt_builder . mkdir ~/mybuild docker run -v ~/mybuild:/home/user -it openwrt_builder /bin/bash
下载官方最新稳定版本的SDK,解压
1 2
wget https://downloads.openwrt.org/releases/19.07.7/targets/ramips/mt7620/openwrt-sdk-19.07.7-ramips-mt7620_gcc-7.5.0_musl.Linux-x86_64.tar.xz tar xvf openwrt-sdk-19.07.7-ramips-mt7620_gcc-7.5.0_musl.Linux-x86_64.tar.xz
使用master的feeds
1 2 3 4 5 6
cd openwrt-sdk-19.07.7-ramips-mt7620_gcc-7.5.0_musl.Linux-x86_64 cat << EOF >feeds.conf src-git base https://git.openwrt.org/openwrt/openwrt.git src-git packages https://git.openwrt.org/feed/packages.git src-git routing https://git.openwrt.org/feed/routing.git EOF
更新feeds,安装frr
1 2
./scripts/feeds update -a ./scripts/feeds install frr
# parameters # $1 the interface name used by pppd (e.g. ppp3) # $2 the tty device name # $3 the tty device speed # $4 the local IP address for the interface # $5 the remote IP address # $6 the parameter specified by the 'ipparam' option to pppd
case "$1" in pppoe-wan) if [ ${gateway_length} -le 15 ]; then echo IPv4 ip route add x.x.x.x via $GW dev $DEV else echo "IPV6 or Unrecognized IP format '$5'" fi ;; *) ;; esac
#!/bin/sh case "$1" in bound) if [ eth0.46 = "${interface}" ]; then ip route add 10.0.0.0/7 via ${router} ip link del vxlan5 ip link add vxlan5 type vxlan id 5 local ${ip} dstport 4789 nolearning ip link set vxlan5 type bridge_slave neigh_suppress on learning off fi ;; esac exit 0
OpenWrt# show bgp l2vpn evpn BGP table version is 0, local router ID is 198.18.22.130 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete EVPN type-1 prefix: [1]:[ESI]:[EthTag]:[IPlen]:[VTEP-IP] EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP] EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP] EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP] EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
Network Next Hop Metric LocPrf Weight Path Route Distinguisher: 198.18.8.244:2 *> [2]:[0]:[48]:[f6:96:37:a3:82:8f]:[32]:[100.69.0.2] 11.92.111.32 0 65005 65008 i RT:65008:5 ET:8 *> [2]:[0]:[48]:[f6:96:37:a3:82:8f]:[128]:[fe80::f496:37ff:fea3:828f] 11.92.111.32 0 65005 65008 i RT:65008:5 ET:8 *> [3]:[0]:[32]:[11.92.111.32] 11.92.111.32 0 65005 65008 i RT:65008:5 ET:8 Route Distinguisher: 198.18.22.130:2 *> [2]:[0]:[48]:[4a:73:1d:22:4c:e3]:[32]:[100.69.0.1] 11.94.117.77 32768 i ET:8 RT:65022:5 *> [2]:[0]:[48]:[4a:73:1d:22:4c:e3]:[128]:[fe80::4873:1dff:fe22:4ce3] 11.94.117.77 32768 i ET:8 RT:65022:5 *> [3]:[0]:[32]:[11.94.117.77] 11.94.117.77 32768 i ET:8 RT:65022:5