1

Seeking to make a netctl profile for a tap device. Here is the info I was given about the connection.

GATEWAY=192.168.117.1  
DNS=192.168.117.1  
BROADCAST=255.255.255.255 **or** 192.168.117.255 (*I was given both of these different values*)  
PREFIX=31  
STATIC IP ADDRESS=192.168.117.2/24  
TYPE=TAP  

Netctl includes some examples. I used the one I found in examples/tuntap:

Description='Example tuntap connection'
Interface=tun0
Connection=tuntap
Mode='tun'
User='nobody'
Group='nobody'

## Example IP configuration
#IP=static
#Address='10.10.1.2/16'

Here is the profile I came up with:

Description='My tap connection'
Interface=tap0
Connection=tuntap
Mode='tap'
User='nobody'
Group='nobody'
IP=static
Address='192.168.117.2/24'
UsePeerDNS=true
DefaultRoute=true
SkipDAD=yes
DHCPReleaseOnStop=yes

Questions

  • Do I need to specify the broadcast address or gateway?
  • Is a prefix needed (and what is prefix 31)?
  • Is there anything else I have overlooked?
  • Note that tap is a level 2 device, so you typically put them inside a bridge (which can also be configured in netctl). If you don't use a bridge, there's really to reason to use a tap device instead of a tun device (tap will incur additional overhead). Most applications (you didn't say which application creates your) can be configured to provide both tun or tap interfaces. – dirkt Jul 22 '18 at 7:09
1
  1. Do I need to specify the broadcast address or gateway?

From the looks of this article/thread titled: [SOLVED] Static IP wired connection doesn't work with netctl the broadcast address can be incorporated into the static IP's definition.

For example, they provided you with this:

BROADCAST=255.255.255.255 or 192.168.117.255 (I was given both of these different values)

I'd assume that the 2nd one, 192.168.117.255, is in fact correct, which would be a /24 mask, hence your Address= already has it:

Address='192.168.117.2/24'
  1. Is a prefix needed (and what is prefix 31)?

Prefixes or, prefix lengths, are described here in these two articles titled:

excerpt

The prefix length is just a shorthand way of expressing the subnet mask. The prefix length is the number of bits set in the subnet mask; for instance, if the subnet mask is 255.255.255.0, there are 24

This table shows how they're calculated:

                                 ss1

So in your case, this information is a bit confusing. Your network address appears to be /24, but your prefix length is 31 bits. In either case, I'd ignore the 31 for the time being, and go with the /24.

  1. Is there anything else I have overlooked?

Everything else in your example profile appears to check out. You should be good to go.

References

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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