网络环境
主路由:TP-5400,pppoe 拨号,ip: 192.168.0.1 开启 dhcp 设置:网关 /dns:192.168.0.2,下发单臂路由;主路由负责 dhcp,设置静态 dhcp 表。
网关:N1,静态 ip:192.168.0.2,网关:192.168.0.1,dns:192.168.0.1 helloworld 策略:海外 ip 走渠道。
坑 1:开启 dhcp 之后,只能访问谷歌,国内网站不行。
解决方案: 在 N1 上加上防火墙规则:
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE 这样就可以实现国内国外网站都访问了
坑 2:端口转发
在主路由设置端口转发之后(源端口,目标 ip,目标端口):
如果目标及其的网关是 N1,能连上端口但是收不到回包 比如 ssh:
debug1: Connecting to xxx port yyy. debug1: Connection established. ... kex_exchange_identification: read: Operation timed out rdp: 已连上,卡在后面了。
想问下防火墙还要怎么设置呢。。
(记得以前被坑过一次,有点忘记了。。
