知乎專欄 | 多維度架構 | 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者” |
目錄
$ sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 0
or just checking out the value in the /proc system
$ cat /proc/sys/net/ipv4/ip_forward 0
sysctl -w net.ipv4.ip_forward=1
or
#redhat echo 1 > /proc/sys/net/ipv4/ip_forward #debian/ubuntu echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward;
sysctl -w net.ipv4.ip_forward=0
or
echo 0 > /proc/sys/net/ipv4/ip_forward
without rebooting the system
$ sysctl net.ipv4.ip_forward net.ipv4.ip_forward = 0
try out ping host from 192.168.0.2 to 192.168.0.1 , 172.16.0.1 and 172.16.0.254
you can access 192.168.0.1 , 172.16.0.1, but 172.16.0.254 time out
sysctl -w net.ipv4.ip_forward=1
try again ping 172.16.0.254