1 iptables centos port-forwarding
我的电脑有两个 IP 地址。如何使用CentOS 将端口80
上的传入请求转发到来8080
自我的 IPiptables
之一?
例如,我有 ip 地址1.1.1.1
和2.2.2.2
,我想将http://1.1.1.1
端口转发80
到端口8080
,1.1.1.1
但不是2.2.2.2
。
我该怎么做呢?
小智 6
iptables -t nat -A PREROUTING -d 1.1.1.1 -p tcp --dport 80 -j DNAT --to-destination 1.1.1.1:8080
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1191 次 |
最近记录: |