# DCC and iptables

## monkeydog

Ok, my eternal device is ppp0. internal eth0, my ip is 192.168.0.2 servers is .0.1

I have set mirc to use the dcc ports 4990-4999.

Trying to get DCC sending working.

Ive tried to make a script,

iptables -A FORWARD -i ppp0 -p tcp --dport 4990 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4991 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4992 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4993 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4994 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4995 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4996 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4997 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4998 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4999 -j ACCEPT

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4090 -j DNAT --to-destination 192.168.0.2:4990

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4091 -j DNAT --to-destination 192.168.0.2:4991

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4092 -j DNAT --to-destination 192.168.0.2:4992

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4093 -j DNAT --to-destination 192.168.0.2:4993

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4094 -j DNAT --to-destination 192.168.0.2:4994

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4095 -j DNAT --to-destination 192.168.0.2:4995

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4096 -j DNAT --to-destination 192.168.0.2:4996

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4097 -j DNAT --to-destination 192.168.0.2:4997

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4098 -j DNAT --to-destination 192.168.0.2:4998

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4099 -j DNAT --to-destination 192.168.0.2:4999

Dosnt seem to work. Any help would be appreciated.

----------

## monkeydog

oopsies, dport was wrong

----------

## monkeydog

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4990 -j DNAT --to-destination 192.168.0.2:4990

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4991 -j DNAT --to-destination 192.168.0.2:4991

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4992 -j DNAT --to-destination 192.168.0.2:4992

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4993 -j DNAT --to-destination 192.168.0.2:4993

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4994 -j DNAT --to-destination 192.168.0.2:4994

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4995 -j DNAT --to-destination 192.168.0.2:4995

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4996 -j DNAT --to-destination 192.168.0.2:4996

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4997 -j DNAT --to-destination 192.168.0.2:4997

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4998 -j DNAT --to-destination 192.168.0.2:4998

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 4999 -j DNAT --to-destination 192.168.0.2:4999

iptables -A FORWARD -i ppp0 -p tcp --dport 4990 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4991 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4992 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4993 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4994 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4995 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4996 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4997 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4998 -j ACCEPT

iptables -A FORWARD -i ppp0 -p tcp --dport 4999 -j ACCEPT

Incase anyone wanted to know

----------

## psp

Hello,

Do you have the IRC helper module loaded? (ip_conntrack_irc)

Try:

```
$ lsmod | grep ip_conntrack_irc
```

If it is not loaded try:

```
 $ modprobe ip_conntrack_irc
```

 and try DCC again.

Hope this helps...

----------

## monkeydog

Yeah, its working now (from second post)

I could do with some help getting msn messenger sending working though,

i thought i had it, but guess not.

----------

## NrG

You dont have to open/forward any port to be able to allow dcc transfers/chats. Specialy for this the guy's @ netfilter made the helpers.

If you compile the IRC module into the kernel you will have to login into an irc server on port 6667. As i know from experiance Mirc connects randomly on servers on diferent ports so this wouldnt be a good solution. So their are 2 options you have. 1 is to make Mirc force to alsways connect on port 6667 (this is not always possible, depents on the irc server) 

2 is to compile this IRC helper as a module and add this to your modules.autoload and adjust it to your needs.

ip_conntrack_irc ports=6660,6664,6665,6666,6667,6668,6669,6670

ip_nat_irc ports=6660,6664,6665,6666,6667,6668,6669,6670

with this set the helper will monitor all the ports.

And if you have the chance use Xchat instead of Mirc. On linux or windows.

NrG

----------

## monkeydog

Could anyone suguest what i should put to get msn messengers file sending working?

```

$IPT -A tcp_inbound -p TCP -s 0/0 --destination-port 6891:6900 -j ACCEPT

$IPT -A tcp_inbound -p TCP -j RETURN

$IPT -A tcp_outbound -p TCP -s 0/0 -j ACCEPT

```

was a script I found, but the tcp_inbound part didnt seem to happy.,

James

----------

## Bangz

You will not be able to get MSN File Sends to work, because you will need uPnP.

I'm in the same situation as you, I want both MSN File Sends to work and mIRC File Sends to work, but Ive had no luck over the last couple months.

My lsmod looks like this:

ipt_TOS                  920  22  (autoclean)

ipt_mac                  600   1  (autoclean)

ipt_MASQUERADE          1272   1  (autoclean)

ip_nat_irc              2320   0  (unused)

ip_conntrack_irc        2864   2  [ip_nat_irc]

ipt_state                536   3  (autoclean)

ipt_LOG                 3224   9  (autoclean)

ipt_limit                888   3  (autoclean)

iptable_nat            14936   3  (autoclean) [ipt_MASQUERADE ip_nat_irc]

ip_conntrack           19040   4  (autoclean) [ipt_MASQUERADE ip_nat_irc ip_conntrack_irc ipt_state iptable_nat]

iptable_mangle          2008   1  (autoclean)

iptable_filter          1612   1  (autoclean)

ip_tables              11032  11  [ipt_TOS ipt_mac ipt_MASQUERADE ipt_state ipt_LOG ipt_limit iptable_nat iptable_mangle iptable_filter]

I'm running gShield with the option for IRC enabled with ports 6666 and 6667.

mIRC File Recieves work fine, but mIRC File Sends do not work.

Anyone able to help?

----------

