我想编写一个工具来生成和修改在AVM Fritzbox路由器中运行的VPN服务器的cfg文件。
为了能够搜索解析器 - 您知道这种文件格式的名称吗?
example.cfg:
<pre>
vpncfg {
connections {
enabled = yes;
conn_type = conntype_lan;
name = "locationa.dyndns.org";
always_renew = no;
reject_not_encrypted = no;
dont_filter_netbios = yes;
localip = 0.0.0.0;
local_virtualip = 0.0.0.0;
remoteip = 0.0.0.0;
remote_virtualip = 0.0.0.0;
remotehostname = "locationa.dyndns.org";
localid {
fqdn = "locationb.dyndns.org";
}
remoteid {
fqdn = "locationa.dyndns.org";
}
mode = phase1_mode_aggressive;
phase1ss = "all/all/all";
keytype = connkeytype_pre_shared;
key = "ed1e2786?z.cbedf6s189315e6Yfa9fIf8";
cert_do_server_auth = no;
use_nat_t = yes;
use_xauth = no;
use_cfgmode = no;
phase2localid {
ipnet {
ipaddr = 192.168.2.0;
mask = 255.255.255.0;
}
}
phase2remoteid {
ipnet {
ipaddr = 192.168.1.0;
mask = 255.255.255.0;
}
}
phase2ss = "esp-all-all/ah-none/comp-all/pfs";
accesslist = "permit ip any 192.168.1.0 255.255.255.0";
}
ike_forward_rules = "udp 0.0.0.0:500 0.0.0.0:500",
"udp 0.0.0.0:4500 0.0.0.0:4500";
}
// EOF
答案 0 :(得分:0)
cfg
只是一个配置文件。它没有特别的名字。
您可能更愿意编写自己的解析器来创建文件。