fan 的个人资料searching for hope照片日志列表 工具 帮助

日志


11月3日

网络配置脚本NETSH DUMP

网络配置脚本NETSH DUMP

C:\Documents and Settings\jks>netsh dump >c:\netsh.txt

C:\Documents and Settings\jks>NETSH ?

用法: NETSH [-a AliasFile] [-c Context] [-r RemoteMachine]
             [Command | -f ScriptFile]

下列指令有效:

此上下文中的命令:
?              - 显示命令列表。
add            - 在项目列表上添加一个配置项目。
bridge         - 更改到 `netsh bridge' 上下文。
delete         - 在项目列表上删除一个配置项目。
diag           - 更改到 `netsh diag' 上下文。
dump           - 显示一个配置脚本。
exec           - 运行一个脚本文件。
firewall       - 更改到 `netsh firewall' 上下文。
help           - 显示命令列表。
interface      - 更改到 `netsh interface' 上下文。
ras            - 更改到 `netsh ras' 上下文。
routing        - 更改到 `netsh routing' 上下文。
set            - 更新配置设置。
show           - 显示信息
winsock        - 更改到 `netsh winsock' 上下文。

下列的子上下文可用:
 bridge diag firewall interface ras routing winsock

若需要命令的更多帮助信息,请键入命令,
后面跟 ?。

#========================
# 接口配置
#========================
pushd interface

reset all


popd
# 接口配置结束

#========================
# 接口配置
#========================
pushd interface ipv6

uninstall


popd
# 接口配置结束

 

# ----------------------------------
# ISATAP 配置
# ----------------------------------
pushd interface ipv6 isatap

 

popd
# ISATAP 配置结束

 

# ----------------------------------
# 6to4 配置
# ----------------------------------
pushd interface ipv6 6to4

reset

 

popd
# 6to4 配置结束

#=============
# 端口代理配置
#=============
pushd interface portproxy

reset


popd
# 端口代理配置结束

 

# ---------------------------------- 
# 接口 IP 配置         
# ---------------------------------- 
pushd interface ip


# "本地连接 4" 的接口 IP  配置

set address name="本地连接 4" source=dhcp 
set dns name="本地连接 4" source=dhcp register=PRIMARY
set wins name="本地连接 4" source=dhcp


popd
# 接口 IP 配置结束


                                            
# ----------------------------------------- 
# RAS 配置                         
# ----------------------------------------- 
pushd ras

set authmode mode = standard
delete authtype type = PAP
delete authtype type = SPAP
delete authtype type = MD5CHAP
delete authtype type = MSCHAP
delete authtype type = MSCHAPv2
delete authtype type = EAP
add authtype type = MSCHAP
add authtype type = MSCHAPv2
delete link type = SWC
delete link type = LCP
add link type = SWC
add link type = LCP
delete multilink type = MULTI
delete multilink type = BACP
add multilink type = MULTI
add multilink type = BACP


set tracing component = * state = disabled

popd

#  RAS 配置结束。                  
                                             
                                             

                                            
# ----------------------------------------- 
# 远程访问 AppleTalk 配置      
# ----------------------------------------- 
pushd ras appletalk

set negotiation mode = allow
set access mode = all

popd

# 远程访问 AppleTalk 配置结束。


                                            
# ----------------------------------------- 
# RAS IP 配置                      
# ----------------------------------------- 
pushd ras ip

delete pool

set negotiation mode = allow
set access mode = all
set addrreq mode = deny
set broadcastnameresolution mode = disabled
set addrassign method = auto

popd

# RAS IP 配置结束。               
                                             

                                            
# ----------------------------------------- 
# RAS IPX 配置                      
# ----------------------------------------- 
pushd ras ipx

set negotiation mode = allow
set access mode = all
set nodereq mode = allow
set netassign method = autosame

popd

# RAS IPX 配置结束。               
                                             
                                             

                                            
# ----------------------------------------- 
# RAS NBF 配置                      
# ----------------------------------------- 
pushd ras netbeui

set negotiation mode = allow
set access mode = all

popd

#  RAS NBF 配置结束。               
                                             
                                             

                                            
# ----------------------------------------- 
# RAS AAAA 配置                    
# ----------------------------------------- 
pushd ras aaaa

set authentication provider = windows
set accounting provider = windows

delete authserver name = *
delete acctserver name = *

 

popd

# RAS AAAA 配置结束。             
                                             
                                             
# 路由配置
pushd routing
reset
popd

#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#
#                                                         #
#   在运行这个脚本之前                                    #
#                                                         #
# 要恢复 IPX 路由器配置,您必须首先从                     #
# 网络连接文件夹中卸载 IPX 然后将其重                     #
# 新安装。                                                #
#                                                         #
#   这样会删除旧的 IPX 路由器配置                         #
#   并将 IPX 路由器配置复原为默认                         #
#   值                                                    #
#                                                         #
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!#

#----------------------------------------------------------
# IPX 配置
#----------------------------------------------------------

pushd routing ipx

#----------------------------------------------------------
# IPX 接口配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 传输筛选器配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 静态路由配置
#----------------------------------------------------------


#----------------------------------------------------------
# IPX 静态服务器配置
#----------------------------------------------------------


popd

# IPX 配置完毕

#----------------------------------------------------------
# IPX RIP 配置
#----------------------------------------------------------

pushd routing ipx rip
popd


# End of IPX RIP 配置

#----------------------------------------------------------
# IPX SAP 配置
#----------------------------------------------------------

pushd routing ipx sap
popd


# IPX SAP 配置完毕

#----------------------------------------------------------
# IPX NETBIOS 配置
#----------------------------------------------------------

pushd routing ipx netbios
popd


# IPX NB 配置完毕
# IP 配置
pushd routing ip
reset
set loglevel error
add preferenceforprotocol proto=LOCAL preflevel=1
add preferenceforprotocol proto=NetMgmt preflevel=10
add preferenceforprotocol proto=STATIC preflevel=3
add preferenceforprotocol proto=NONDOD preflevel=5
add preferenceforprotocol proto=AUTOSTATIC preflevel=7
add preferenceforprotocol proto=OSPF preflevel=110
add preferenceforprotocol proto=RIP preflevel=120
add interface name="本地连接 4" state=enable
set filter name="本地连接 4" fragcheck=disable
add interface name="环回" state=enable
set filter name="环回" fragcheck=disable
add interface name="内部" state=enable
set filter name="内部" fragcheck=disable
popd
# IP 配置的尾端

 

# ---------------------------------- 
# DNS 代理配置            
# ---------------------------------- 
pushd routing ip dnsproxy
uninstall


popd
# DNS 代理配置结束

 

# ---------------------------------- 
# IGMP 配置                 
# ---------------------------------- 
pushd routing ip igmp
uninstall


popd
# IGMP 配置结束

 

# ---------------------------------- 
# NAT 配置                  
# ---------------------------------- 
pushd routing ip nat
uninstall


popd

 


# ---------------------------------- 
# OSPF 配置                 
# ---------------------------------- 

pushd routing ip ospf
uninstall

popd
# OSPF 配置结束

 


# ---------------------------------- 
# DHCP 中继代理配置    
# ---------------------------------- 
pushd routing ip relay
uninstall


popd
# DHCP 中继配置结束

 

# ---------------------------------- 
# RIP 配置                  
# ---------------------------------- 
pushd routing ip rip
uninstall


popd
# RIP 配置结束

 

# ---------------------------------- 
# 路由器探索配置     
# ---------------------------------- 
pushd routing ip routerdiscovery
uninstall
add interface name="本地连接 4" disc=disable minint=7 maxint=10 life=30 level=0
add interface name="环回" disc=disable minint=7 maxint=10 life=30 level=0
add interface name="内部" disc=disable minint=7 maxint=10 life=30 level=0


popd


# ---------------------------------- 
# DHCP 分配器配置       
# ---------------------------------- 
pushd routing ip autodhcp
uninstall


popd
# DHCP 分配器配置结束


# ------------------------------------
# 桥配置 (不支持)
# ------------------------------------

# ------------------------------------
# 桥配置结束
# ------------------------------------