Answers:
该命令sudo echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
被解释为您(非root用户)将结果sudo echo "net.ipv4.ip_forward = 1"
写入/etc/sysctl.conf。
跑
sudo -s 'echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf'
要么
sudo su -c 'echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf'
以echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
root 身份运行。
sudo -i