- 论坛徽章:
- 0
|
本帖最后由 zljjg2000 于 2015-03-20 17:27 编辑
D盘:\chengxu\目录下有n个目录(目录举例为:1942-干休四所,1943-电器),
“1942-干休四所”目录下有个文件“1942-干休四所”,内容如下:
interface Vlan-interface1083
description baijinhan-1-adsl
ip address 172.16.1.2 255.255.255.240
#
interface Vlan-interface1800
description zhuanxian2
ip address 192.168.1.1 255.255.255.248
#
interface Vlan-interface1802
description zhuanxian3
ip address 192.168.10.1 255.255.255.240
ip address 192.168.20.1 255.255.255.224 sub
#
interface Vlan-interface1803
description zhuanxian4
shutdown
ip address 192.168.32.1 255.255.255.248
#
“1943-电器”目录下有个文件“1943-电器”,内容如下:
interface Vlan-interface2098
description abc-bar
ip address 172.30.1.2 255.255.255.240
#
interface Vlan-interface1800
description zzz
ip address 192.168.100.1 255.255.255.248
最终需要在目录D盘:\chengxu\result下,生成一个最终文件,内容为:
interface Eth-Trunk1.100
description baijinhan-1-adsl
control-vid 100 qinq-termination
qinq termination pe-vid 1942 ce-vid 1083
ip address 172.16.1.2 255.255.255.240
arp broadcast enable
ip urpf loose
interface Eth-Trunk1.101
description zhuanxian2
control-vid 101 qinq-termination
qinq termination pe-vid 1942 ce-vid 1800
ip address 192.168.1.1 255.255.255.248
arp broadcast enable
ip urpf loose
interface Eth-Trunk1.102
description zhuanxian3
control-vid 102 qinq-termination
qinq termination pe-vid 1942 ce-vid 1802
ip address 192.168.10.1 255.255.255.240
ip address 192.168.20.1 255.255.255.224 sub
arp broadcast enable
ip urpf loose
interface Eth-Trunk1.103
description zhuanxian4
control-vid 103 qinq-termination
qinq termination pe-vid 1942 ce-vid 1803
shutdown
ip address 192.168.32.1 255.255.255.248
arp broadcast enable
ip urpf loose
interface Eth-Trunk1.104
description abc-bar
control-vid 104 qinq-termination
qinq termination pe-vid 1943 ce-vid 2098
ip address 172.30.1.2 255.255.255.240
arp broadcast enable
ip urpf loose
interface Eth-Trunk1.105
description zzz
control-vid 105 qinq-termination
qinq termination pe-vid 1943 ce-vid 1800
ip address 192.168.100.1 255.255.255.248
arp broadcast enable
ip urpf loose
请注意:红色部分是取自原有目录下的相应字段,且Eth-Trunk1.xxx是递增的,
若目录下的子目录有n个,如何适应扩展呢?比如有这些目录:1942-a,1943-b,1944-c,1945-d,1946-a.... |
|