这种方法无需重启:
[root@ha02 ~]# cat /proc/sys/net/ipv4/ip_forward0[root@ha02 ~]# sysctl -w net.ipv4.ip_forward=1net.ipv4.ip_forward = 1[root@ha02 ~]# cat /proc/sys/net/ipv4/ip_forward1
[root@ha02 ~]# sysctl -p /etc/sysctl.conf
net.ipv4.ip_forward = 0net.ipv4.conf.default.rp_filter = 1net.ipv4.conf.default.accept_source_route = 0kernel.sysrq = 0kernel.core_uses_pid = 1net.ipv4.tcp_syncookies = 1kernel.msgmnb = 65536kernel.msgmax = 65536kernel.shmmax = 68719476736kernel.shmall = 4294967296