《网吧规划的命令清单》由会员分享,可在线阅读,更多相关《网吧规划的命令清单(4页珍藏版)》请在金锄头文库上搜索。
1、网吧规划命令清单1.设置主路由做NAT转换。内网可以PING通外网,外网不可以PING通内网MainR#en MainR#conf tEnter configuration commands, one per line. End with CNTL/Z.MainR(config)#ip nat pool clien 61.138.5.9 61.138.5.9 netmask 255.255.255.252MainR(config)#access-list 1 permit 192.168.1.0 0.0.0.255MainR(config)#access-list 1 permit 192.1
2、68.2.0 0.0.0.255MainR(config)#access-list 1 permit 192.168.3.0 0.0.0.255MainR(config)#access-list 1 permit 192.168.4.0 0.0.0.255MainR(config)#access-list 1 permit 192.168.5.0 0.0.0.255MainR(config)#ip nat inside source list 1 pool clien overloadMainR(config)#int fa0/0MainR(config-if)#ip nat insideMa
3、inR(config)#int fa0/1MainR(config-if)#ip nat outside2.设置宣告,让外网可以对其内网特定服务器访问。MainR(config)#ip nat inside source static 61.138.5.100 192.168.4.7MainR(config)#ip nat inside source static 61.138.5.101 192.168.4.83.设置三层交换机开启路由功能MainSW#conf tEnter configuration commands, one per line. End with CNTL/Z.Main
4、SW(config)#no ? access-list Add an access list entry banner Define a login banner boot Modify system boot parameters cdp Global CDP configuration subcommands clock Configure time-of-day clock config-register Define the configuration register enable Modify enable password parameters hostname Set syst
5、ems network name interface Select an interface to configure ip Global IP configuration subcommands ipv6 Global IPv6 configuration commands mac-address-table Configure the MAC address table port-channel EtherChannel configuration router Enable a routing process service Modify use of network based ser
6、vices spanning-tree Spanning Tree Subsystem username Establish User Name Authentication vlan Vlan commands vtp Configure global VTP stateMainSW(config)#no routing4.关闭三层交换机与路由器连接端口的二层功能。开启三层功能MainSW(config)#int fa0/20MainSW(config-if)#no switchport5.设置FA0/20端口IP地址与网关属于同一网段,设置路由协议OSPFMainSW(config)#in
7、t fa0/20MainSW(config-if)#ip add 172.16.0.253 255.255.255.0MainSW(config)#route ospf 1MainSW(config-router)#network 192.168.1.0 0.0.0.255 area 0MainSW(config-router)#network 192.168.2.0 0.0.0.255 area 0MainSW(config-router)#network 192.168.3.0 0.0.0.255 area 0MainSW(config-router)#network 192.168.4.
8、0 0.0.0.255 area 0MainSW(config-router)#network 192.168.5.0 0.0.0.255 area 06:配置主路由和三层交换机OSPF属于同一区域Router#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname MainRMainR(config)#route ospf 1MainR(config-router)#network 172.16.0.0 0.0.3.255 area 0配置备份路由上网功能:AuxRen
9、AuxR#show ip int briefInterface IP-Address OK? Method Status Protocol FastEthernet0/0 172.17.0.254 YES manual up up FastEthernet0/1 211.200.100.9 YES manual up up Vlan1 unassigned YES manual administratively down downAuxR#conf tEnter configuration commands, one per line. End with CNTL/Z.AuxR(config)
10、#ip nat pool clien2 211.200.100.9 211.200.100.9 netmask 255.255.255.252AuxRenAuxR#conf tEnter configuration commands, one per line. End with CNTL/Z.AuxR(config)#end%SYS-5-CONFIG_I: Configured from console by consoleAuxR#enAuxR#conf tAuxR(config)#ip nat pool clien2 211.200.100.9 211.200.100.9 netmask
11、 255.255.255.252AuxR(config)#access-list 2 permit 192.168.1.0 0.0.0.255 AuxR(config)#access-list 2 permit 192.168.2.0 0.0.0.255 AuxR(config)#access-list 2 permit 192.168.3.0 0.0.0.255 AuxR(config)#access-list 2 permit 192.168.4.0 0.0.0.255 AuxR(config)#access-list 2 permit 192.168.5.0 0.0.0.255 AuxR
12、(config)#ip nat inside source list 2 pool clien2 overloadAuxR(config)#int fa0/0AuxR(config-if)#ip nat insideAuxR(config-if)#exitAuxR(config)#int fa0/1AuxR(config-if)#ip nat outside 、三层交换机设置DHCP服务器分配IP给商务MainSWenMainSW#conf tEnter configuration commands, one per line. End with CNTL/Z.MainSW(config)#v
13、lan 400MainSW(config-vlan)#name APMainSW(config-vlan)#exitMainSW(config)#int vlan 400%LINK-5-CHANGED: Interface Vlan400, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan400, changed state to upMainSW(config-if)#MainSW(config-if)#MainSW(config-if)#ip add 192.168.5.254 255.255.2
14、55.0MainSW(config-if)#exitMainSW(config)#ip dhcp pool APMainSW(dhcp-config)#dns-server 172.16.0.254MainSW(dhcp-config)#default-router 192.168.5.254MainSW(dhcp-config)#network 192.168.5.0 255.255.255.0MainSW(dhcp-config)#exitMainSW(config)#end划分VLANServergroupSW(config)#vlan 10ServergroupSW(config-vlan)#name ServerServergroupSW(config-vlan)#?VLAN configuration commands: exit Apply changes, bump revision number, and exit mode name Ascii name of the VLAN no Negate a command or set its defaultsSer