我正在尝试从我们的产品中删除路由器并使用 iptables 替换其所有功能。
该系统需要执行一般流量控制以及将数据转发到位于 LAN 后面的特定服务器。当前设置是 -
eth0 通过 DHCP 获取 IP。
eth1、eth2 和 eth3 构成桥 (br0) 的一部分,其静态地址为 10.0.1.1。
有一个位于 10.0.1.2 上的服务器需要处理 HTTP 和 MySQL 流量。无法保证此服务器将插入 (eth1/2/3) 的位置,但 IP 是静态的。
我试图设置 iptables 规则,这似乎很容易只用一个 eth 设备就可以遵循,但是当需要转发时,我陷入了困境。
这是我迄今为止尝试过的:
# clear and flush everything
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw …Run Code Online (Sandbox Code Playgroud)