public static NetworkTap createFromFile(File configurationFile) throws FileNotFoundException {
        NetworkTap tap = new NetworkTap(null);

        BufferedReader reader = new BufferedReader(new FileReader(configurationFile));
        String line;
        String rule = "";
        boolean inRule = false;
        try {
            while ((line = reader.readLine()) != null) {
                if (line.startsWith("filter rule")) {
                    rule = line;
                    inRule = true;
                } else if (inRule && line.startsWith("!")) {
                    inRule = false;
                    tap.addFilter(FilterUtils.createFilter(rule));
                } else if (inRule) {
                    rule += line + "\n";
                } else if (line.startsWith("port") && line.contains("name")) {
                    Pattern pat = Pattern.compile("port (\\d+) name *\"([^\"]+)\"");
                    Matcher mat = pat.matcher(line);
                    if (mat.matches()) {
                        NetworkInterface iface = new NetworkInterface(tap, mat.group(1));
                        iface.setIfaceDescription(mat.group(2));
                        tap.addIface(iface);
                    }
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(NetworkTap.class.getName()).log(Level.SEVERE, null, ex);
        }

        return tap;
    }