显示当前使用的网络接口
$ ip addr | awk '/state UP/ {print $2}' | sed 's/.$//' 输出结果 eth0 eth1
$ ip addr | awk '/state UP/ {print $2}' | sed 's/.$//' 输出结果 eth0 eth1
RB750Gr3备份license key 原系统的license key最好备份下,以备还原官方系统。 电脑连接路由器LAN口,用Winbox登录路由器,在system下找到license管理,将license export即可备份。 下载openwrt镜像 一共需要两个文件 Firmware OpenWrt Install openwrt-23.05.3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin openwrt-21.02.3-ramips-mt7621-mikrotik_routerboard-750gr3-initramfs-kernel.bin Firmware OpenWrt Upgrade openwrt-23.05.3-ramips-mt7621-mikrotik_routerboard-750gr3-squashfs-sysupgrade.bin openwrt-21.02.3-ramips-mt7621-mikrotik_routerboard-750gr3-squashfs-sysupgrade.bin 第一个是网络引导安装镜像,第二个是升级包,上面链接失效的话可以去官方下载页找找。 网络引导写入initramfs kernel 这里使用的工具是Tiny PXE,下载pxesrv_Tiny_PXE_Server_1.0.0.23.zip 密码3705 下载后,编辑config.ini文件,在[dhcp]部分下添加rfc951=1参数 右键管理员打开pxesrv.exe 最上面默认为HTTPd Option 54(DHCP Server)处,勾选当前固网IP(192.168.1.10) 在Boot File中Filename后,选择openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin文件 将Boot File中Filename if use-class=gPXE or iPXE去掉勾选 其余默认即可,点击右上角三个按钮中间的Online 将网线连接到路由器WAN口,断电,用卡针按住RES按钮,上电后观察USR灯,连闪三下后,再闪一下后熄灭马上放开RES按钮,此时路由器进入netboot模式 看到Tiny pxe窗口出现DoReadFile:openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin即可,如下log: 14:10:50 ROOT=D:\\rb750\\ 14:10:50 DHCPd 192.168.1.10:67 started... 14:10:50 TFPTd 192.168.1.10:69 started... 14:10:51 HTTPd:80 started... 14:11:27 DHCPd:DISCOVER received, MAC:64-D1-54-9F-79-0F, XID:9D74838A 14:11:28 DHCPd:OFFER sent, IP:192.168.1.11, XID:9D74838A 14:11:28 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-0F, XID:9D74838A 14:11:28 DHCPd:ACK sent, IP:192.168.1.11, XID:9D74838A 14:12:01 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-0F, XID:ECAC163F 14:12:01 DHCPd:BOOTP REQUEST 14:12:01 TFTPd:DoReadFile:openwrt-ramips-mt7621-mikrotik_rb750gr3-initramfs-kernel.bin B:1452 T:0 14:12:01 DHCPd:ACK sent, IP:192.168.1.21, XID:ECAC163F 14:12:19 DHCPd:DISCOVER received, MAC:64-D1-54-9F-79-11, XID:F919527A 14:12:19 DHCPd:OFFER sent, IP:192.168.1.12, XID:F919527A 14:12:19 DHCPd:REQUEST received, MAC:64-D1-54-9F-79-11, XID:F919527A 14:12:19 DHCPd:ACK sent, IP:192.168.1.12, XID:F919527A 此时initramfs kernel已经以RAM方式运行在路由器中,可以关闭Tiny PXE了 ...
https://mirrors.ustc.edu.cn/openwrt/ 说明: OpenWRT/LEDE 下载站镜像。 这是对https://downloads.openwrt.org/的完整镜像,内容包括官方支持的平台的 ROM、SDK 及工具链、软件仓库镜像等。 使用说明: 一般情况下,下载来自downloads.openwrt.org的文件时,将 URL 中的这部分域名替换为mirrors.ustc.edu.cn/openwrt即可。 如要使用本镜像作为 OpenWRT/LEDE 系统 opkg 软件仓库,SSH 登录路由器编辑/etc/opkg/distfeeds.conf文件,同样按照上面的方法替换域名即可。可以使用如下命令操作: sed -i 's/downloads.openwrt.org/mirrors.ustc.edu.cn\/openwrt/g' /etc/opkg/distfeeds.conf 之后运行opkg update更新软件索引,注意检查是否出现错误。 via https://mirrors.ustc.edu.cn/help/openwrt.html
安装完OpenWRT基本系统后,是无法通过WEB来进行管理的,需要安装LUCI才可以 将路由器WAN口连接到一个已经联网的路由器下,然后电脑LAN口连接新路由,通过以下方法开安装LUCI。 建议安装前将OpenWRT/LEDE更换国内源,这样可以更加快速安装软件。 $ ssh [email protected] #默认密码为空 The authenticity of host \'192.168.1.1 (192.168.1.1)\' can\'t be established. RSA key fingerprint is SHA256:UElnmEDlnbdNWutb3J8IjXbBMxbdOJYzHNYYp9lTYKw. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added \'192.168.1.1\' (RSA) to the list of known hosts. BusyBox v1.30.0 () built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt SNAPSHOT, r9028-75fdf3b ----------------------------------------------------- === WARNING! ===================================== There is no root password defined on this device! Use the \"passwd\" command to set up a new password in order to prevent unauthorized SSH logins. -------------------------------------------------- root@OpenWrt:~# opkg update #更新软件源 Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_core Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/kmods/4.14.91-1-26f5ed44a4b010654f5ec58e94ee7c46/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_kmods Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/kmods/4.14.91-1-26f5ed44a4b010654f5ec58e94ee7c46/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_base Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_luci Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_packages Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages/Packages.sig Signature check passed. Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_routing Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing/Packages.sig Signature check passed.\r\nDownloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony/Packages.gz Updated list of available packages in /var/opkg-lists/openwrt_telephony Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony/Packages.sig Signature check passed.\r\nroot@OpenWrt:~# opkg install luci #安装luci Installing luci (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci_git-19.013.40861-80ac438-1_all.ipk Installing uhttpd (2018-11-28-cdfc902a-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/uhttpd_2018-11-28-cdfc902a-1_mipsel_24kc.ipk Installing liblua (5.1.5-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/liblua_5.1.5-1_mipsel_24kc.ipk Installing lua (5.1.5-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/lua_5.1.5-1_mipsel_24kc.ipk Installing luci-lib-nixio (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-lib-nixio_git-19.013.40861-80ac438-1_mipsel_24kc.ipk Installing luci-lib-ip (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-lib-ip_git-19.013.40861-80ac438-1_mipsel_24kc.ipk Installing rpcd (2018-11-28-3aa81d0d-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/rpcd_2018-11-28-3aa81d0d-1_mipsel_24kc.ipk Installing libubus-lua (2018-10-06-221ce7e7-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/libubus-lua_2018-10-06-221ce7e7-1_mipsel_24kc.ipk Installing luci-lib-jsonc (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-lib-jsonc_git-19.013.40861-80ac438-1_mipsel_24kc.ipk Installing liblucihttp (2018-05-18-cb119ded-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/liblucihttp_2018-05-18-cb119ded-1_mipsel_24kc.ipk Installing liblucihttp-lua (2018-05-18-cb119ded-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/liblucihttp-lua_2018-05-18-cb119ded-1_mipsel_24kc.ipk Installing luci-base (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-base_git-19.013.40861-80ac438-1_mipsel_24kc.ipk Installing libiwinfo (2018-12-25-dd508af4-1) to root... Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/libiwinfo_2018-12-25-dd508af4-1_mipsel_24kc.ipk Installing libiwinfo-lua (2018-12-25-dd508af4-1) to root... Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/libiwinfo-lua_2018-12-25-dd508af4-1_mipsel_24kc.ipk Installing luci-mod-status (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-mod-status_git-19.013.40861-80ac438-1_mipsel_24kc.ipk Installing luci-mod-system (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-mod-system_git-19.013.40861-80ac438-1_all.ipk Installing luci-mod-network (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-mod-network_git-19.013.40861-80ac438-1_all.ipk Installing luci-mod-admin-full (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-mod-admin-full_git-19.013.40861-80ac438-1_all.ipk Installing luci-theme-bootstrap (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-theme-bootstrap_git-19.013.40861-80ac438-1_all.ipk Installing luci-app-firewall (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-app-firewall_git-19.013.40861-80ac438-1_all.ipk Installing luci-app-opkg (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-app-opkg_git-19.013.40861-80ac438-1_all.ipk Installing luci-proto-ppp (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-proto-ppp_git-19.013.40861-80ac438-1_all.ipk Installing luci-proto-ipv6 (git-19.013.40861-80ac438-1) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/luci-proto-ipv6_git-19.013.40861-80ac438-1_all.ipk Installing rpcd-mod-rrdns (20170710) to root... Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/rpcd-mod-rrdns_20170710_mipsel_24kc.ipk Configuring luci-app-opkg. Configuring rpcd. Configuring liblua. Configuring luci-lib-ip. Configuring libubus-lua. Configuring libiwinfo. Configuring libiwinfo-lua. Configuring lua. Configuring luci-lib-nixio. Configuring luci-lib-jsonc. Configuring liblucihttp. Configuring liblucihttp-lua. Configuring luci-base. Configuring luci-mod-system. Configuring luci-theme-bootstrap. Configuring luci-mod-status. Configuring luci-app-firewall. Configuring luci-proto-ppp. Configuring luci-mod-network. Configuring luci-mod-admin-full. Configuring luci-proto-ipv6. Configuring uhttpd. Configuring rpcd-mod-rrdns. Configuring luci. root@OpenWrt:~# #安装完成,重启即可 重启后,就可以通过访问192.168.1.1来进行web端管理了,root默认密码为空,记得添加密码咯! ...
UNIX的/etc目录 早期系统/bin是用来存放程序(可执行二进制文件)的,然后有了/dev用来存放设备文件,和/lib用来存放库文件。/usr目录很早也有了,首先用来存放用户数据,后来也放一些用户级的/bin和/lib,man形式的用户手册也存放在此。 随着系统越来越庞大,一些无法进行归类的文件就放到了/etc目录,后来慢慢的大家将/etc目录用来存放一些系统级的配置文件,现代unix系统上,几乎所有的配置文件都在/etc目录,etc是et cetera的缩写。 I assure you that the original contents of /etc were the “et cetera” that didn’t seem to fit elsewhere. Other variants might do their own etymologies differently. Regards, Dennis Dennis: Dennis Richie 一些小Tips git通过ssh访问远程repo git cloe ssh://user@host:port/repo.git 编辑完 /etc/default/grub 后,用grub-mkconfig -o /boot/grub/grub.cfg更新配置。 从大到小显示目录内容 du -s * | sort -nr 创建固定大小文件 dd if=/dev/zero of=100M.test bs=100M count=1 Notepad++删除包含关键字的行 .*delete.* 强制复制所有内容 \cp -rf * target/ 将unixetc.txt中的AAA替换为BBB sed -i -e 's/AAA/BBB/g' unixetc.txt 将当前目录下所有html文件内的AAA替换为BBB find ./ -name "*.html" -exec grep "AAA" {} \; -exec sed -i 's/AAA/BBB/g' {} \; 删除unixetc.txt中的第3-17行内容 sed -i -e '3,17d' unixetc.txt Ubuntu安装多媒体扩展 sudo apt install ubuntu-restricted-extras Ubuntu卸载snapd sudo apt autoremove --purge snapd GIT配置代理 git config --global http.proxy socks5://127.0.0.1:20170 socks5为代理协议,可配置http/https/socks5等。 pip设置国内源 pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip临时使用国内源自升级 python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip SCP下载远程文件 scp -P port user@ip:/path/file ./ git卡writing objects,可以将远端地址改为ssh方式 git remote set-url origin [email protected]:username/repo.git git备份归档 git archive --format=zip --output=repobak_$(date +%Y-%m-%d).zip master PowerShell激活Windows&Office irm https://get.activated.win | iex