I need to forward some ports from my E-smith gateway to an internal server using ipmasqasm. While searching through posts on the forum, I found this very informative link about the use of ipmasqadm with a dynamic IP:
http://www.linux.org/docs/ldp/howto/mini/IPMasquerading+Napster-5.htmlAs my external interface is connected to the Net via ADSL (PPPoE) with a dynamic IP address, the script I'm interested in is :
#!/bin/sh
ppp_ip="/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed -e
's/.*://'"
/usr/sbin/ipmasqadm portfw -f
/usr/sbin/ipmasqadm portfw -a -P tcp -L ${ppp_ip} 20 -R 192.168.0.2 20
/usr/sbin/ipmasqadm portfw -a -P tcp -L ${ppp_ip} 21 -R 192.168.0.2 21
My question is : Is such a script directly usable in E-smith 4.1 & if yes, in which template should I put it (I'm considering /etc/e-smith/templates/etc/ppp/ip-up.local/signal-event) ?
And what would be the "cleanest" way to insert it ?
If that's not appropriate, could you suggest any other option ?
Thanks in advance for any help !