Skip to contentSkip to conversation

Port Forward UDP 1911

DISCUSSION Paul Yip 1 participant 1 message Mar 12, 2003

lore
Share & tools
lore

Paul Yip

author
#0 lore raw

Dear all,

3 Computers are linked together with cross over cable and computer B is the router.

Computer A - Starlight Video Server(Solaris)
- 192.168.0.11

Computer B - Iptables(Linux)
- eth0 - 192.168.0.12
- eth1 - 158.192.92.102

Computer C - Video receiver(Windows)
- 158.192.92.105

First

# echo "1" > /proc/sys/net/ipv4/ip_forward 

it works fine, video receiver can receive the video from 192.168.0.11. The purpose for using iptables is that Internet use can get access our video

server, also our video server can be protected by iptables.

Second
modprobe iptables
for TABLE in filter nat mangle; do
iptables -t $TABLE -F
iptables -t $TABLE -X
done;
iptables -t nat -A PREROUTING -p udp --dport 1911 -i eth1 -j \
DAT --to 192.168.0.11: 1911
iptables -A FORWARD -p udp --dport 1911 -d 192.168.0.11 --j ACCEPT

Video receiver can receive the video, but when we investigate the packets go

into video receiver.
Source IP: 192.168.0.11:1911
Destination IP: 158.192.92.105: 1069
Protocol: UDP
Packet Len: 1.46KB
Data Len: 1.42KB

Third, we execute one more line in order to change the source IP

# iptables -nat -A POSTROUTING -o eth1 -j \ 
SNAT --to 158.192.92.102 

But the result doesn't change, we still get packet with source IP. 192.168.0

11.

I'd be grateful for any helps or advices.

Paul Yip