本文是笔者学习路由器的笔记
基本原理
应用
软路由
Windows
开启 IP 转发:
Try to go to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters. If not already there, create a new REG_DWORD value named IPEnableRouter. Set IPEnableRouter to 1 and reboot. Packet forwarding should now be enabled.
To add static routes use the route command.
以及:
1
PS C:\WINDOWS\system32> Set-NetIPInterface -Forwarding Enabled
详情参见:How can I enable packet forwarding on Windows? - Server Fault
Linux
开启 IP 转发:
临时:
1
sysctl net.ipv4.ip_forward=1
或者:
1
echo "1" >/proc/sys/net/ipv4/ip_forward
永久:
1
echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf
链接
下面总结了本文中使用的所有链接: