1 pcscf端口转发

双网卡,pcscf运行在内网4060端口,通过访问192.168.22.22:5060 访问pcscf
192.168.22.0/24 192.168.22.22:5060 (eth1 外网 )
10.0.80.12:4060 (eth0 内网地址)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
graph TD
subgraph 双网卡服务器
A[eth0: 10.0.80.12] -->|内网通信| B[PCSCF :4060]
C[eth1: 192.168.22.22] -->|外网暴露| D[5060端口]
end

subgraph 内网环境
E[ICSCF/SCSCF] -->|访问| B
end

subgraph 外网环境
F[客户端/终端] -->|访问| D
end

style A stroke:#555,stroke-width:2px
style C stroke:#f66,stroke-width:2px
style B stroke:#090,stroke-width:2px
style D stroke:#900,stroke-width:2px
1
2
3
4
iptables -t nat -A PREROUTING -i eth4 -s 192.168.22.0/24 -d 192.168.22.22 -p udp --dport 5060  -j DNAT  --to 10.0.80.12:4060
iptables -t nat -A PREROUTING -i eth4 -s 192.168.22.0/24 -d 192.168.22.22 -p udp --dport 4060 -j DNAT --to 10.0.80.12:4060
iptables -t nat -A PREROUTING -i eth4 -s 192.168.22.0/24 -d 192.168.22.22 -p tcp --dport 5060 -j DNAT --to 10.0.80.12:4060
iptables -t nat -A PREROUTING -i eth4 -s 192.168.22.0/24 -d 192.168.22.22 -p tcp --dport 4060 -j DNAT --to 10.0.80.12:4060