Code:
EXT_IF="eth0"
INT_IF="eth1"
INT_LAN="192.168.0.0/24"
This is just variable settings, setting up the internal and extranal interface names and the last line is just a variable that says a subnet mask 255.255.255.0 which means a full class C subnet can be used (i.e. 254 computers on the network).
Code:
# This is the line that extracts the ip:
EXT_IP=$(ifconfig $EXT_IF | grep inet | sed s'/.*addr:\([0-9\.]*\)\ .*/\1/')
This is just trying to find out the current EXTENAL IP addres (i.e. your WAN address), really only necessary for DYNAMIC IP setups.
Code:
# Allow DC++ connections to firewall
ipchains -A input -j ACCEPT -s 0/0 -d $EXT_IP 1412 -p tcp -i $EXT_IF
ipchains -A input -j ACCEPT -s 0/0 -d $EXT_IP 1412 -p udp -i $EXT_IF
This is just opening the port 1412 for TCP and UDP traffic so that the firewall is not blocking it anymore.
Code:
# Forward DC++ connections
ipmasqadm portfw -a -P tcp -L $EXT_IP 1412 -R $YOUR_IP 1412
ipmasqadm portfw -a -P udp -L $EXT_IP 1412 -R $YOUR_IP 1412
This is then forwarding the TCP and UDP traffic on port 1412 to the LAN machine with IP address $YOUR_IP which would be of the form 192.162.0.X.
That help?