Click to See Complete Forum and Search --> : a question on portforwarding


LoRdMaUL
08-18-2002, 11:51 PM
I am currently running a RedHat 7.3 with kernel 2.4.18-3 using Firestarter as my firewall and NAT. I was told that it is possible to get the video and voice chat features of Yahoo Messenger to work properly using portforwarding. He sent me the ports I need to forward to make this work. Problem is...I have no idea how to forward the ports. I see a reference to ipmasqadm but when i do a locate on this on my box...it doesn't seem to be installed. Is there a RPM for it? I didn't see it on my cds and when I went to http://rpmfind.net I didn't find one expressly for redhat 7.3. Here is what he said I needed to put in my rc.local:

ipmasqadm portfw -a -P udp -L 24.x.x.x.x 2090 -R 192.168.0.6 2090

ipmasqadm portfw -a -P udp -L 24.x.x.x.x 2091 -R 192.168.0.6 2091

The 24.x.x.x is apparently his static IP address on his linux box. I don't have a static IP address....I am on dialup and my IP changes everytime...what would I put in for that in my case?

Any information or pointing me to documentation on this would be greatly appreciated.

jumpedintothefire
08-19-2002, 01:48 AM
---quote---
ipmasqadm portfw -a -P udp -L 24.x.x.x.x 2090 -R 192.168.0.6 2090
------------
With a 2.2 kernel, yes that works....

You may want to read my reply here:

http://linuxnewbie.org/forum/showthread.php?s=&threadid=60468

you need a PREROUTING rule to portforward with iptables, it has replaced ipmasqadm....

LoRdMaUL
08-19-2002, 10:59 AM
ok...this may be a silly question...but since I am running RedHat 7.3 with a 2.4 kernel...I would more than likely be running IPTables? I know I have seen references to IPChains somewhere on my system...

jumpedintothefire
08-20-2002, 04:39 AM
lsmod will show you which module is loaded

LoRdMaUL
08-20-2002, 10:22 PM
ok...here is the results of my lsmod...

Module Size Used by Not tainted
nls_iso8859-1 3488 1 (autoclean)
ppp_deflate 4000 1 (autoclean)
zlib_deflate 21344 0 (autoclean) [ppp_deflate]
ppp_async 8256 1 (autoclean)
ppp_generic 24140 3 (autoclean) [ppp_deflate ppp_async]
slhc 6508 0 (autoclean) [ppp_generic]
sr_mod 16920 2 (autoclean)
via82cxxx_audio 20480 0 (autoclean)
uart401 7936 0 (autoclean) [via82cxxx_audio]
ac97_codec 11936 0 (autoclean) [via82cxxx_audio]
sound 71916 0 (autoclean) [via82cxxx_audio uart401]
soundcore 6692 5 (autoclean) [via82cxxx_audio sound]
binfmt_misc 7556 1
autofs 12132 0 (autoclean) (unused)
ipt_ttl 1568 1 (autoclean)
ipt_limit 1952 35 (autoclean)
ipt_unclean 7872 3 (autoclean)
ip_nat_irc 3680 0 (unused)
ip_nat_ftp 4320 0 (unused)
ipt_state 1536 6 (autoclean)
iptable_mangle 3136 0 (unused)
ipt_LOG 4736 1
ipt_MASQUERADE 2464 1
ipt_TOS 1952 0 (unused)
ipt_REDIRECT 1728 0 (unused)
iptable_nat 20980 3 [ip_nat_irc ip_nat_ftp ipt_MASQUERADE ipt_REDIRECT]
ipt_REJECT 4096 0 (unused)
ip_conntrack_irc 3840 0 (unused)
ip_conntrack_ftp 5056 0 (unused)
ip_conntrack 21132 4 [ip_nat_irc ip_nat_ftp ipt_state ipt_MASQUERADE ipt_REDIRECT iptable_nat ip_conntrack_irc ip_conntrack_ftp]
iptable_filter 2752 1 (autoclean)
ip_tables 13952 14 [ipt_ttl ipt_limit ipt_unclean ipt_state iptable_mangle ipt_LOG ipt_MASQUERADE ipt_TOS ipt_REDIRECT iptable_nat ipt_REJECT iptable_filter]
eepro100 20240 1
ide-scsi 9664 1
scsi_mod 108608 2 [sr_mod ide-scsi]
ide-cd 30272 0
cdrom 32224 0 [sr_mod ide-cd]
usb-ohci 20736 0 (unused)
usb-uhci 24452 0 (unused)
usbcore 73216 1 [usb-ohci usb-uhci]
ext3 67136 1
jbd 49400 1 [ext3]

It looks like I am using IPTables?

jumpedintothefire
08-21-2002, 12:50 AM
------------
ipt_ttl 1568 1 (autoclean)
ipt_limit 1952 35 (autoclean)
ipt_unclean 7872 3 (autoclean)
ip_nat_irc 3680 0 (unused)
ip_nat_ftp 4320 0 (unused)
ipt_state 1536 6 (autoclean)
iptable_mangle 3136 0 (unused)
ipt_LOG 4736 1
ipt_MASQUERADE 2464 1
ipt_TOS 1952 0 (unused)
ipt_REDIRECT 1728 0 (unused)
iptable_nat 20980 3 [ip_nat_irc ip_nat_ftp ipt_MASQUERADE ipt_REDIRECT]
ipt_REJECT 4096 0 (unused)
ip_conntrack_irc 3840 0 (unused)
ip_conntrack_ftp 5056 0 (unused)
ip_conntrack 21132 4 [ip_nat_irc ip_nat_ftp ipt_state ipt_MASQUERADE ipt_REDIRECT iptable_nat ip_conntrack_irc ip_conntrack_ftp]
iptable_filter 2752 1 (autoclean)
ip_tables 13952 14 [ipt_ttl ipt_limit ipt_unclean ipt_state iptable_mangle ipt_LOG ipt_MASQUERADE ipt_TOS ipt_REDIRECT iptable_nat ipt_REJECT iptable_filter]
------------

Think I'll go out on the limb and say iptables..........

quewhatque
08-21-2002, 02:11 AM
follow the instructions for the last post (mine) on this thread
http://linuxnewbie.org/forum/showthread.php?s=&threadid=60468


then when you got iptables running,

##EXTINF is your interface to the internet
##forward port 2090 and 2091
# iptables -t nat -A PREROUTING -p udp --dport 2090 -i EXTINF -j DNAT --to-destination 192.168.0.6:2090
# iptables -t nat -A PREROUTING -p udp --dport 2091 -i EXTINF -j DNAT --to-destination 192.168.0.6:2091
# iptables -A FORWARD -d 192.168.0.6 -i EXTINF -p udp -m tcp --dport 2090 -j ACCEPT
# iptables -A FORWARD -d 192.168.0.6 -i EXTINF -p udp -m tcp --dport 2091 -j ACCEPT

##then turn on masqerading
# iptables -P FORWARD DROP
# iptables -A FORWARD -s 192.168.0.0/255.255.255.0 -j ACCEPT
# iptables -A FORWARD -d 192.168.0.0/255.255.255.0 -j ACCEPT
# iptables -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o EXTINF -j MASQUERADE


and everything should be set...at least i hope so

LoRdMaUL
08-21-2002, 03:41 PM
OK...let me cut to the chase here....what I want to do is forward port 5050 to 192.168.01 on my internal LAN so I can use the video and voice chat features of Yahoo Messenger. My external interface is ppp0....

Would these two statements do what I am wanting to do?

/sbin/iptables -t nat -A PREROUTING -p tcp -i ppp0 -xxx.xxx.xxx.xxx
--dport 5050 -j DNAT --to 192.168.0.1:5050

/sbin/iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.1 --dport 5050 -j ACCEPT

I saw this on http://www.hackorama.com/network/portfwd.shtml and tried to adapt them to what I am wanting to do. Could one of you networking gurus take a looksie and let me know?....:)