banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix NAT port 554  XML
  [Question]   NAT port 554 22/11/2011 09:07:03 (+0700) | #1 | 250198
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]
Hi all, mình có 1 câu hỏi muốn hỏi mọi người,
mô hình của mình.

server A ( 192.168.1.8 ) ------------- ( 192.168.1.9)(eth0) server B(eth0:1) ( 210.210.210.210 )----internet.


server A: windows.
server B: Readhat.

trên A, mình cài Streaming, với rtsp, mình đã mơ port 554, người dùng trong LAN có thể: rtsp://192.168.1.8/test để nghe nhạc.

trên B. mình đã NAT IPTABLES với conf sau:
IPTABLES=/sbin/iptables
$IPTABLES -F
$IPTABLES -F -t nat
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE

$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p icmp
$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p tcp
$IPTABLES -A INPUT -j ACCEPT -m state --state ESTABLISHED -i eth0 -p udp
###
#$IPTABLES -t nat -A PREROUTING -p tcp -i eth0 -d 210.210.210.210 --dport 554 -j DNAT --to 192.168.1.8:554
#$IPTABLES -A FORWARD -p tcp -i eth0 -d 192.168.1.8 --dport 554 -j ACCEPT

#$IPTABLES -t nat -A PREROUTING -i 210.210.210.210 -p tcp --dport 554 -j DNAT --to-dest 192.168.1.8:554

#$IPTABLES -t nat -A PREROUTING -s any/0 -d 192.168.1.8 -p tcp --dport 554 -j DNAT --to-destination 210.210.210.210:554

#$IPTABLES -A INPUT -p tcp --dport 554 -j ACCEPT

$IPTABLES -A FORWARD -i 210.210.210.210 -o 192.168.168.32 -p tcp -d 192.168.1.8 --dport 554 -j ACCEPT
$IPTABLES -A FORWARD -i 210.210.210.210 -o 192.168.168.32 -p udp -d 192.168.1.8 --dport 554 -j ACCEPT

$IPTABLES -t nat -A PREROUTING --dst 210.210.210.210 -p tcp --dport 554 -j DNAT --to-destination 192.168.1.8:554
$IPTABLES -t nat -A PREROUTING --dst 210.210.210.210 -p udp --dport 554 -j DNAT --to-destination 192.168.1.8:554

----------------------------------
( với dòng in đậm, là 1 số conf của mình đã thử)

đứng trên máy ngoài inter,
telnet 210.210.210.210 554 >>>>ok.

nhưng:
rtsp://210.210.210.210/test >>> not ok....
------------
mình muốn hỏi, các bạn đã NAT với server streaing ở đằng sau, thì sẽ làm ntn?

note:
với 1 trong các conf trên, mình đã NAT ok, ftp, web


thank
[Up] [Print Copy]
  [Question]   NAT port 554 23/11/2011 12:32:43 (+0700) | #2 | 250234
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]
Các bạn cho ý kiến với.
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 10:45:31 (+0700) | #3 | 250413
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]
Mình theo dõi bài này, hix. nhưng ko có ai muốn giúp thì pải.
1 mình vừa là tác giả, vừa là người xem luôn smilie
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 11:43:57 (+0700) | #4 | 250414
phuongnvt
Member

[Minus]    0    [Plus]
Joined: 09/02/2011 03:35:39
Messages: 332
Offline
[Profile] [PM]
đọc cái này coi có giúp được gì cho bồ không nha
http://lists.netfilter.org/pipermail/netfilter/2004-July/054648.html
Nhiều người nhận được lời khuyên, song chỉ có những người khôn mới sử dụng lời khuyên đó


[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:31:56 (+0700) | #5 | 250417
leduyhiepx
Member

[Minus]    0    [Plus]
Joined: 02/06/2010 23:36:15
Messages: 10
Offline
[Profile] [PM]
sao nat rồi vẫn còn comment nhỉ ? "#"
#system-config-securitylevel
#vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 554 -j ACCEPT
mình nat thử ok mà ?
[root@server1 ~]# service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]
[root@server1 ~]#
 
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:45:55 (+0700) | #6 | 250418
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]
Hi all,
những dòng comment lại là những dòng mình đã thử, nhưng ko co được?

ở đây tiện thể mình nói luôn. streaming server là: Windows Media Services, với cơ chế streaming là: On-Demand.
ở trong LAN mình đã : rtsp://ip/nhac.mp3 chạy ok, nhưng khi NAT qua server LINUX để từ ngoài có thể dùng được. rtsp://IPINTERNET:port/nhac.mp3
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:45:56 (+0700) | #7 | 250419
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]
Hi all,
những dòng comment lại là những dòng mình đã thử, nhưng ko co được?

ở đây tiện thể mình nói luôn. streaming server là: Windows Media Services, với cơ chế streaming là: On-Demand.
ở trong LAN mình đã : rtsp://ip/nhac.mp3 chạy ok, nhưng khi NAT qua server LINUX để từ ngoài có thể dùng được. rtsp://IPINTERNET:port/nhac.mp3
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:48:45 (+0700) | #8 | 250421
leduyhiepx
Member

[Minus]    0    [Plus]
Joined: 02/06/2010 23:36:15
Messages: 10
Offline
[Profile] [PM]
bạn thử loại bỏ những dòng thừa đi rồi bạn config iptables với GUI xem sao . theo mình nghĩ chẳng cần ipinternet:port gì đó đâu bạn chỉ cần nat theo mình là đủ vì nó cho any ip vào trừ khi bạn dùng nhiều server mới cần phải chỉ rõ ip của mỗi em ?
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:52:08 (+0700) | #9 | 250422
[Avatar]
thuannghich
Member

[Minus]    0    [Plus]
Joined: 04/09/2008 00:06:08
Messages: 82
Offline
[Profile] [PM]

leduyhiepx wrote:
sao nat rồi vẫn còn comment nhỉ ? "#"
#system-config-securitylevel
#vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 554 -j ACCEPT
mình nat thử ok mà ?
[root@server1 ~]# service iptables restart
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: filter [ OK ]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[ OK ]
[root@server1 ~]#
 
 

leduyhiepx wrote:
bạn thử loại bỏ những dòng thừa đi rồi bạn config iptables với GUI xem sao . theo mình nghĩ chẳng cần ipinternet:port gì đó đâu bạn chỉ cần nat theo mình là đủ vì nó cho any ip vào trừ khi bạn dùng nhiều server mới cần phải chỉ rõ ip của mỗi em ? 


thank bạn đã repy lại mình.

bạn có thể cho mình yahoo hoặc skyper để tiện nói chuyện ko?
rồi sau đó, nếu đựoc, mình sẽ note lại và up lên diễn đàn để mọi người cùng học tập.
[Up] [Print Copy]
  [Question]   NAT port 554 28/11/2011 12:54:33 (+0700) | #10 | 250423
leduyhiepx
Member

[Minus]    0    [Plus]
Joined: 02/06/2010 23:36:15
Messages: 10
Offline
[Profile] [PM]
nick Y!M của mình như tên luôn đó bạn
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|