Commandline configuring portforwarding service with whitespace
We have a ZyXEL VMG8324-B10A router at home. I am able to log in via ssh and use the command portforward --help
, which results in the following output:
Usage: portforward config <ServiceName> --wanintf <atm0.1|atm1.1|ptm0.1|ptm0.2|ptm0.3|eth4.1|eth4.2|eth4.3|eth3G> [--wanip <wanip>]
--sipaddr <ServerIP Addr> --sport <Trigger Start Port> <Trigger End Port>
--transport <Translation Start Port> <Translation End Port>
--proto <tcp|udp|tcpudp> <enable|disable>
portforward delete <ServiceName> --sipaddr <ServerIP Addr>
portforward show
portforward --help
The forwarding rule that I want to alter looks like (portforward show
):
Service Wan ServerIP Trigger End Trans. Trans.
# Status Name Intf. WanIP Address StartPort Port StartPort EndPort Portocol
------------------------------------------------------------------------------------------------------------------------
2 enable PC HTTP [conn] [old-ip] 80 80 80 80 TCP
I want to alter this rule to make it forward to [new-ip]
. However, the command portforward config "PC HTTP" --sipaddr [new-ip]
results in
portforward: invalid parameter HTTP" for option 'config'
Is the format of the command I entered correct? And how can I change the IP address this rule points to?
EDIT: The huawei router appears to be our previous one. We currently have one from ZyXEL.
Solution 1:
Actually answering your comments here:
the point of this whole story is that I need to be able to modify the port forwarding parameters from a remote location. If I am at home, I can just use the web interface
and
When I have logged in into a raspberry pi via ssh from another network I have no access to the web interface
It seems like you have a Raspberry Pi at home you can ssh into from your remote location and you would like to access the router's web interface as if you were on the home network.
If this is your problem, you can use SSH port forwarding:
ssh -L 8080:192.168.1.1:443 raspberrypi
where raspberrypi
is the Raspberry Pi's hostname or ~/.ssh/config
entry you use to connect to it. This allows you to establish a tunnel from your remote location to the Raspberry Pi at home. If you visit https://localhost:8080
on your browser from the remote location, the request is forwarded by your Raspberry Pi to the home router's ip (192.168.1.1
in this example) on port 443
, which is the https web management page in my hypothesis.
This is safer than opening the web management interface to the public Internet (although you could restrict access by IP) and easier than setting up a VPN just for this purpose.
Another option would be to do X forwarding and launch the Raspberry Pi's browser from your remote location. This is however going to be slower as you would be forwarding the whole graphical application instead of just tunnelling the data. and clumsier, too, because the browser would have to be run by the Raspberry Pi's CPU instead of your hopefully more powerful remote computer's.