[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Port forwarding from the ip-up scripts



Hello folks.
I am having some degree of trouble getting port forwarding to work seamlessly.  The firewall is a potato box running ipchains and the default ipmasq scripts. 
 
I can manually run:
 
ipmasqadm portfw -a -P tcp -L (current IP address of ppp0) 80 -R 192.168.1.50 80
 
without any problem, but I have been trying to get it to initialise from the ip-up scripts.
Like this
 
#!/bin/sh
# This script is /etc/ppp/ip-up.d/fw
ipmasqadm portfw -f
ipmasqadm -p tcp -L $4 80 -R 192.168.1.50 80
 
and so on for other ports and protocols.  The $4 should equate to the local IP address since those are the variables which pppd exports for the run-parts scripts.  I made sure that the script was marked executable, but that didn't help.
 
I have also tried running the commands from within /etc/ip-up.
 
Has anyone had any joy with this method, or can anyone suggest another?
 
Thanks
 
Ben Tullis 

Reply to: