Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out what that + sign means in a rule such as this:

-A FORWARD -i tun0+ -j ACCEPT

I'm pretty positive it relates to vpn. I noticed a /dev/net/tun interface and a tun0 in ifconfig, but for the sake of thoroughness, I want to know about that + sign. Anyone know anything?

share|improve this question
Ok, so it seems that the + is a wildcard that is mentioned under the spec of the -i flag. hmmm now to figure out why. – Realn0whereman Apr 12 '11 at 21:33
Is that really tun0+, and not tun+? As far as I know tun0+ would only match tun0 anyway, whereas tun+ would match tun0, tun1, tun2, … – Gilles Apr 12 '11 at 22:03
Yes it is, that's why I'm stumped. In the server config for openvpn, it is "dev tun0", so would openvpn create tun01 tun02 etc... for concurrent vpn connections? – Realn0whereman Apr 12 '11 at 22:37
dev tun0 will force creation of tun0 device. If you want to dynamically create tun devices and don't care which server uses which device, then use dev tun so tun0, tun1, tun2, ... be created subsequently and tun+ in iptables rules will match all of them. – forcefsck Apr 13 '11 at 13:12
@Realn0whereman: Where did you find this rule anyway? – Gilles Apr 13 '11 at 19:57

From here: To match all interfaces of a type, use the plus sign such as eth+.

And yes, the "+" sign means here just as "*" in pattern matching or ".*" in regexps.

This rule is false, the + is unneeded, although it don't even harms (because a tunnel named tun01 or tun05 are very unlikely). The developer of this script wanted to write probably only tun+.

share|improve this answer

Actually it does work for all ip blocks in that interface. It means, if you have tun0, tun0:0, and tun0:1 and you need to manage all, you will probably want to write tun0+ there.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.