I have some general questions on redirect rules as follows.
In regard to this example:
config redirect
option name 'WAN12345_LAN2345'
option target 'DNAT'
option src 'wan'
option src_ip '7.7.7.7'
option src_ip '8.8.8.8'
option src_mac 'aa:bb:cc:dd:ee:ff:gg'
option src_mac 'hh:ii:jj:kk:ll:mm:nn'
option src_dport '12345'
list proto 'tcp'
list proto 'udp'
option dest 'lan'
option dest_ip '192.168.0.1'
option dest_port '2345'
Q1. Is it right that, when the same option is repeated two or more times, traffic need only satisfy one of them? In other words,
option src_ip '7.7.7.7'
option src_ip '8.8.8.8'
amounts to saying that the source IP must be either the one or the other?
Q2. Is it right that different options must all be satisfied. In other words,
option src_ip '7.7.7.7'
option src_mac 'aa:bb:cc:dd:ee:ff:gg'
amounts to saying it must both be the case that source I.P. is 7.7.7.7 and that source MAC is aa:bb:cc:dd:ee:ff:gg?
Q3. Combining Q1 and Q2, the example at the top of this post would mean something like this:
- Source IP must be 7.7.7.7 or 8.8.8.8, and source MAC must be aa:bb:cc:dd:ee:ff:gg or hh:ii:jj:kk:ll:mm:nn, and protocol must be TCP or UDP.
Q4. It seems 'src' as in src_ip
and src_dport
have two different meanings. In src_ip
, 'src' refers to the person (machine) out there trying to satisfy the redirect rule in your OpenWrt (thus src_ip
is his public IP address). But in src_dport
, 'src' means your router's port that the traffic must hit (thus src_dport
is your port, i.e. a port in your router). Do I understand this right?
Q5. When the person out there has the usual setup of a computer sitting behind a router, does src_mac
refer to the MAC of the computer or the router? (I believe this question amounts to asking which MAC the router sends out to the Internet.)
I'd very much appreciate answers like 'Q1 through Q4 yes, Q5 the router's.' But if I am wrong in any of my ideas, I would appreciate being told what would have been right.
Thanks very much.