报错代码:
解决 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
# 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 个设备名称 (必须设置)
# journalctl -xb
# rpm -Va
# depmod -a
# lsmod | grep bonding
(补充:这里以查看 bonding 模块是否还在为例)
# modprobe bonding
(补充:这里以尝试加载 bonding 模块为例)
# ethtool eth0
(补充:这里以查看 eth0 网卡是否接入网路为例)
# ifconfig eth0 192.168.0.2/24
或者:
# ip a add 192.168.0.2/24 dev eth0
(补充:这里以给 eth0 网卡添加临时 IP 地址 192.168.0.2/24 为例)
# route add default gw 192.168.0.1
或者:
# ip route add default via 192.168.0.1
# ip a s
# route -n