Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I saw a iptable command like this:

iptables -t nat -A xx -p tcp -m tcp --dport 80 -j DNAT --to %myweb%:80

what's "%" there for? Thanks. Where I can get a manual to tell me what kind of symbols I can use?

share|improve this question

migrated from stackoverflow.com Sep 9 '12 at 0:04

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

Well, the iptables command there sets up a port forward on TCP from external port 80 to internal port 80 forwarded to whatever IP address or domain is represented by %myweb%. %myweb% seems to be in the same format that Windows uses for its environment variables (on *nix system it would be $MYWEB).

Where did you get this iptables command from? It could just be that the command is an example, and they mean you to manually reply %myweb% with the IP address of your internal web server. Alternately, if it's part of an iptables script, then %myweb% could be getting replaced with the contents of a variable. It's hard to say for sure without knowing its source.

share|improve this answer
    
Thanks. The info is very enough for me. I'm going to check the script if there. :) –  Yang Aug 16 '12 at 23:13
    
Its most likely that the %myweb% is just there as a placeholder to indicate to the user that they need to change this value. –  mikebabcock Sep 9 '12 at 3:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.