报错代码:
解决 Linux 同 1 系统下 2 张网卡在同 1 个网段里只有 1 个网卡可以 ping 通
解决方案:
# sysctl -w net.ipv4.conf.all.rp_filter=2
解决 Linux 同 1 系统下 2 张网卡在同 1 个网段里只有 1 个网卡可以 ping 通
# sysctl -w net.ipv4.conf.all.rp_filter=2
# complete=/dir1/dir2/dir3/dir4/test.file.txt
# echo ${complete#*/}
dir1/dir2/dir3/dir4/test.file.txt
(补充:这里以掐掉从左数第 1 个斜杠 “/” 以及前面的所有所有内容为例)
# complete=/dir1/dir2/dir3/dir4/test.file.txt
# echo ${complete##*/}
test.file.txt
(补充:这里以掐掉从左数最后 1 个斜杠 “/” 以及前面的所有所有内容为例)
# complete=/dir1/dir2/dir3/dir4/test.file.txt
# echo ${complete%.*}
/dir1/dir2/dir3/dir4/test.file
(补充:这里以掐掉从右数第 1 个点 “.” 以及后面的所有所有内容为例)
# complete=/dir1/dir2/dir3/dir4/test.file.txt
# echo ${complete%%.*}
/dir1/dir2/dir3/dir4/test
(补充:这里以掐掉从右数最后 1 个点 “.” 以及后面的所有所有内容为例)
# basename /root/test.txt
test.txt
(补充:这里以去除文件 /root/test.txt 的路径为例)
# basename /root/test.txt /home/mingyuzhu/mingyuzhu.txt
test.txt
(补充:这里以去除文件 /root/test.txt 和文件 /home/mingyuzhu/mingyuzhu.txt 的路径为例)
# basename -a /root/test.txt /home/mingyuzhu/mingyuzhu.txt
test.txt mingyuzhu.txt
(补充:这里以去除文件 /root/test.txt 和文件 /home/mingyuzhu/mingyuzhu.txt 的路径为例)
# basename -s .txt /root/test.txt
test
(补充:这里以去除文件 /root/test.txt 的路径同时去除后缀 .txt 为例)
# type curl
curl is hashed (/usr/bin/curl)
(
补充:
1) 这里以显示 curl 命令为例
2) 从输出的结果可以看出 curl 命令的文件是 /usr/bin/curl 并且已经 hashed
)
# type -t curl
file
(
补充:
1) 这里以显示 curl 命令为例
2) 从输出的结果可以看出 curl 命令的文件类型 file
)
# nmtui
Edit a connection --> <Add> --> Bond
Profile name
给 bond 设置 1 个身份名称 (必须设置)
(补充:建议是 bond0)
Device
给 bond 设置 1 个设备名称 (必须设置)
(补充:建议是 bond0)
Mode:
Active Backup
(补充:强烈建议改成 Active Backup)
IPv4 CONFIGURATION:
<Manual>
(补充:需要修改成 Manual 后才能手动配置 IP 地址)
(步骤略)
BOND Slaves --> <ADD> --> Ethernet
Profile name
给 bond 子网卡设置 1 个设备名称 (必须设置)
(补充:建议是 bond0-slave)
Device
给 bond 子网卡选择 1 个设备名称 (必须设置)