導航:首頁 > 程序命令 > netmask命令

netmask命令

發布時間:2022-05-27 18:47:32

1. 乙太網交換機配置命令

交換機配置命令華為,思科,北電,邁普等配置命令各有不同,以下先以思科設備為例:

switch> 用戶模式
1:進入特權模式 enable
switch> enable
switch#

2:進入全局配置模式 configure terminal
switch> enable
switch#configure terminal
switch(conf)#

3:交換機命名 hostname aptech2950 以aptech2950為例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch-2950
aptech2950(conf)#

4:配置使能口令 enable password cisco 以cisco為例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable password cisco

5:配置使能密碼 enable secret ciscolab 以cicsolab為例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# enable secret ciscolab

6:設置虛擬區域網vlan 1 interface vlan 1 和網關地址
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface vlan 1
aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交換機埠ip和子網掩碼
aptech2950(conf-if)#no shut 是配置處於運行中
aptech2950(conf-if)#exit
aptech2950(conf)#ip default-gateway 192.168.254 設置網關地址

7:進入交換機某一埠 interface fastehernet 0/17 以17埠為例
switch> enable
switch#configure terminal
switch(conf)#hostname aptch2950
aptech2950(conf)# interface fastehernet 0/17
aptech2950(conf-if)#

8:查看命令 show
switch> enable
switch# show version 察看系統中的所有版本信息
show interface vlan 1 查看交換機有關ip 協議的配置信息
show running-configure 查看交換機當前起作用的配置信息
show interface fastethernet 0/1 察看交換機1介面具體配置和統計信息
show mac-address-table 查看mac地址表
show mac-address-table aging-time 查看mac地址表自動老化時間

9:交換機恢復出廠默認恢復命令
switch> enable
switch# erase startup-configure
switch# reload

10:雙工模式設置
switch> enable
switch#configure terminal
switch2950(conf)#hostname aptch-2950
aptech2950(conf)# interface fastehernet 0/17 以17埠為例
aptech2950(conf-if)#plex full/half/auto 有full , half, auto 三個可選項

11:cdp相關命令
switch> enable
switch# show cdp 查看設備的cdp全局配置信息
show cdp interface fastethernet 0/17 查看17埠的cdp配置信息
show cdp traffic 查看有關cdp包的統計信息
show cdp nerghbors 列出與設備相連的cisco設備

12:csico2950的密碼恢復
拔下交換機電源線。
用手按著交換機的MODE鍵,插上電源線
在switch:後執行flash_ini命令:switch: flash_ini
查看flash中的文件: switch: dir flash:
把「config.text」文件改名為「config.old」: switch: rename flash: config.text flash: config.old
執行boot: switch: boot
交換機進入是否進入配置的對話,執行no :
進入特權模式察看flash里的文件: show flash :
把「config.old」文件改名為 「config.text」: switch: rename flash: config.old flash: config.text
把「config.text」拷入系統的「running-configure」: flash: config.text system : running-configure
把配置模式重新設置密碼存檔,密碼恢復成功。

13:交換機telnet遠程登錄設置:
switch>en
switch#configure terminal
switch(conf)#hostname aptech-2950
aptech2950(conf)#enable password cisco 以cisco為特權模式密碼
aptech2950(conf)#interface fastethernet 0/1 以17埠為telnet遠程登錄埠
aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0
aptech2950(conf-if)#no shut
aptech2950(conf-if)#exit
aptech2950(conf)line vty 0 4 設置0-4 個用戶可以telnet遠程登陸
aptech2950(conf-line)#login
aptech2950(conf-line)#password edge 以edge為遠程登錄的用戶密碼
主機設置:
ip 192.168.1.2 主機的ip必須和交換機埠的地址在同一網路段
netmask 255.255.255.0
gate-way 192.168.1.1 網關地址是交換機埠地址
運行:
telnet 192.168.1.1
進入telnet遠程登錄界面
password : edge
aptech2950>en
password: cisco
aptech#

14:交換機配置的重新載入和保存
設置完成交換機的配置後:
aptech2950(conf)#reload
是否保存(y/n) y: 保存設置信息 n:不保存設置信息

15:保存
aptech2950(conf)#wr

另外:思科是沒有中文格式的,華為和邁普有,以下以華為改成中文模式為例:

<Quidway> language-mode chinese
Change language mode, confirm? [Y/N]y
改變到中文模式

2. 思科交換機進特權模式的命令是什麼

router #

2:進入全局配置模式 configure terminal

router > enable

router #c onfigure terminal

router (conf)#

3:交換機命名 hostname routera 以routerA為例

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routera (conf)#

4:配置使能口令 enable password cisco 以cisco為例

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routerA (conf)# enable password cisco

5:配置使能密碼 enable secret ciscolab 以cicsolab為例

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routerA (conf)# enable secret ciscolab

6:進入路由器某一埠 interface fastehernet 0/17 以17埠為例

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routerA (conf)# interface fastehernet 0/17

routerA (conf-if)#

進入路由器的某一子埠 interface fastethernet 0/17.1 以17埠的1子埠為例

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routerA (conf)# interface fastehernet 0/17.1

7:設置埠ip地址信息

router > enable

router #c onfigure terminal

router(conf)#hostname routerA

routerA(conf)# interface fastehernet 0/17 以17埠為例

routerA (conf-if)#ip address 192.168.1.1 255.255.255.0 配置交換機埠ip和子網掩碼

routerA (conf-if)#no shut 是配置處於運行中

routerA (conf-if)#exit

8:查看命令 show

router > enable

router # show version 察看系統中的所有版本信息

show interface vlan 1 查看交換機有關ip 協議的配置信息

show running-configure 查看交換機當前起作用的配置信息

show interface fastethernet 0/1 察看交換機1介面具體配置和統計信息

show mac-address-table 查看mac地址表

show mac-address-table aging-time 查看mac地址表自動老化時間

show controllers serial + 編號 查看串口類型

show ip router 查看路由器的路由表

9:cdp相關命令

router > enable

router # show cdp 查看設備的cdp全局配置信息

show cdp interface fastethernet 0/17 查看17埠的cdp配置信息

show cdp traffic 查看有關cdp包的統計信息

show cdp nerghbors 列出與設備相連的cisco設備

10:csico2600的密碼恢復

重新啟動路由器,在啟動過程中按下win+break鍵,使路由器進入rom monitor

在提示符下輸入命令修改配置寄存器的值,然後重新啟動路由器

remmon1>confreg 0x2142

remmon2>reset

重新啟動路由器後進入setup模式,選擇「no」,退回到exec模式,此時路由器原有的配置仍然保存在startup-config中,為使路由器恢復密碼後配置不變把startup-config中配置保存到running-config中,然後重新設置enable密碼,並把配置寄存器改回 0x2102:

router>enable

router# startup-config running-config

router#c onfigure terminal

router(conf)#enable password cisco

router(conf)#c onfig-register 0x2102

保存當前配置到startup-config , 重新啟動路由器。

router # running-config startup-config

router #reload

11:路由器telnet遠程登錄設置:

router>en

router #c onfigure terminal

router (conf)#hostname routerA

routerA (conf)#enable password cisco 以cisco為特權模式密碼

routerA (conf)#interface fastethernet 0/1 以17埠為telnet遠程登錄埠

routerA (conf-if)#ip address 192.168.1.1 255.255.255.0

routerA (conf-if)#no shut

routerA (conf-if)#exit

routerA (conf)line vty 0 4 設置0-4 個用戶可以telnet遠程登陸

routerA (conf-line)#login

routerA (conf-line)#password edge 以edge為遠程登錄的用戶密碼

主機設置:

ip 192.168.1.2 主機的ip必須和交換機埠的地址在同一網路段

netmask 255.255.255.0

gate-way 192.168.1.1 網關地址是交換機埠地址

運行:

telnet 192.168.1.1

進入telnet遠程登錄界面

password : edge

routera>en

password: cisco

routera#

12:配置路由器的標識 banner $……………$

在全局配置的模式下利用「banner」命令可以配置路由器的提示信息,所有連接到路由器的終端會收到。

router>en

router #c onfigure terminal

router (conf)#hostname routerA

routerA(conf)#banner motd $This is aptech company』 router ! Please don』t change the

configuration without permission!$

13:配置介面標識 description ………

介面標識用於區分路由器的各個介面。

router>en

router #c onfigure terminal

router (conf)#hostname routerA

routerA(conf)#interface fastethernet 0/1 以0/1 介面為例

routerA(conf-if)# description this is a fast Ethernet port used to connecting the company』s intranet!

14:配置超時

超時適用於設置在多長時間沒有對console進行配置,自動返回exec會話時間。默認為10分鍾。

router>en

router #c onfigure terminal

router (conf)#hostname routerA

routerA(conf)#line console 0

routerA(conf-if)#e xec-timeout 0 0 第一個「0」代表分鍾,第二個「0」代表秒

15:配置串口參數

兩台路由器通過串口連接需要一個做為DTE,一個做為DCE。DCE設備要向DTE設備提供時鍾頻率和帶寬。

DCE配置:

router>en

router #c onfigure terminal

router (conf)#hostname routerA

routerA(conf)#interface serial 0/0

routerA(conf_if)#clock rate 64000 提供時鍾頻率為64000

routerA(conf_if)#bandwidth 64 提供帶寬為64

DTE配置:路由器串口配置ip地址

router>en

router #c onfigure terminal

router (conf)#hostname routerB

routerB(conf)#interface serial 0/0

routerB(conf_if)#ip address 192.168.1.1 255.255.255.0

16:靜態路由的配置

配置路由器A的主機名和介面參數

router>enable

router#c onfigure terminal

router(conf)#hostname routerA

routerA(conf)#interface fastethernet 0/1 路由器A的1埠為兩路由器的連接埠

routerA(conf-if)#ip address 192.168.2.1 255.255.255.0

routerA(conf-if)#no shutdown

routerA(conf-if)#exit

routerA(conf)# interface fastethernet 0/0 路由器A的0埠為與主機的連接埠

routerA(conf-if)#ip address 192.168.1.2 255.255.255.0

routerA(conf-if)#no shutdown

主機A的ip地址為 192.168.1.1

255.255.255.0

192.168.1.2

配置路由器B的主機名和介面參數

router>enable

router#c onfigure terminal

router(conf)#hostname routerB

routerB(conf)#interface fastethernet 0/0 路由器B的0埠為兩路由器的連接埠

routerB(conf-if)#ip address 192.168.2.2 255.255.255.0

routerB(conf-if)#no shutdown

routerB (conf-if)#exit

routerB(conf)# interface fastethernet 0/1 路由器B的1埠為與主機的連接埠

routerB(conf-if)#ip address 192.168.3.1 255.255.255.0

主機B的ip地址為 192.168.3.2

255.255.255.0

192.168.3.1

配置路由器A的靜態路由表

routerA(conf)#ip router 192.168.3.0 255.255.255.0 192.168.2.2

配置路由器B的靜態路由表

routerA(conf)#ip router 192.168.1.0 255.255.255.0 192.168.2.1

在routerA和routerB上配置默認路由

routerA(conf)#ip route 0.0.0.0 0.0.0.0 192.168.2.2

routerA(conf)#ip classless

routerB(conf)#ip route 0.0.0.0 0.0.0.0 192.168.2.1

routerB(conf)#ip classless

在routerA和routerB上配置動態路由(RIP)

routerA(conf)#router rip

routerA(conf)#network 192.168.1.0

routerA(conf)#network 192.168.2.0

routerB(conf)# router rip

routerB(conf)#network 192.168.2.0

routerB(conf)#network 192.168.3.0

2. 路由器支持的命令:

路由器顯示命令:

router#show run ;顯示配置信息

router#show interface ;顯示介面信息

router#show ip route ;顯示路由信息

router#show cdp nei ;顯示鄰居信息

router#reload ;重新起動

路由器口令設置:

router>enable ;進入特權模式

router#config terminal ;進入全局配置模式

router(config)#hostname ;設置交換機的主機名

router(config)#enable secret xxx ;設置特權加密口令

router(config)#enable password xxb ;設置特權非密口令

router(config)#line console 0 ;進入控制台口

router(config-line)#line vty 0 4 ;進入虛擬終端

router(config-line)#login ;要求口令驗證

router(config-line)#password xx ;設置登錄口令xx

router(config)#(Ctrl+z) ;

返回特權模式

3. 路由器交換機的配置命令:詳細的來

路由器支持的命令:
路由器顯示命令:
router#show run ;顯示配置信息
router#show interface ;顯示介面信息
router#show ip route ;顯示路由信息
router#show cdp nei ;顯示鄰居信息
router#reload ;重新起動

路由器口令設置:
router>enable ;進入特權模式
router#config terminal ;進入全局配置模式
router(config)#hostname <hostname> ;設置交換機的主機名
router(config)#enable secret xxx ;設置特權加密口令
router(config)#enable password xxb ;設置特權非密口令
router(config)#line console 0 ;進入控制台口
router(config-line)#line vty 0 4 ;進入虛擬終端
router(config-line)#login ;要求口令驗證
router(config-line)#password xx ;設置登錄口令xx
router(config)#(Ctrl+z) ; 返回特權模式
router#exit ;返回命令

路由器配置:
router(config)#int s0/0 ;進入Serail介面
router(config-if)#no shutdown ;激活當前介面
router(config-if)#clock rate 64000 ;設置同步時鍾
router(config-if)#ip address <ip> <netmask> ;設置IP地址
router(config-if)#ip address <ip> <netmask> second ;設置第二個IP
router(config-if)#int f0/0.1 ;進入子介面
router(config-subif.1)#ip address <ip> <netmask> ;設置子介面IP
router(config-subif.1)#encapsulation dot1q <n> ;綁定vlan中繼協議
router(config)#config-register 0x2142 ;跳過配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引導

路由器文件操作:
router# running-config startup-config ;保存配置
router# running-config tftp ;保存配置到tftp
router# startup-config tftp ;開機配置存到tftp
router# tftp flash: ;下傳文件到flash
router# tftp startup-config ;下載配置文件

ROM狀態:
Ctrl+Break ;進入ROM監控狀態
rommon>confreg 0x2142 ;跳過配置文件
rommon>confreg 0x2102 ;恢復配置文件
rommon>reset ;重新引導
rommon> xmodem:<sname> flash:<dname> ;從console傳輸文件

rommon>IP_ADDRESS=10.65.1.2 ;設置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 ;設置路由器掩碼
rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP伺服器IP
rommon>TFTP_FILE=c2600.bin ;指定下載的文件
rommon>tftpdnld ;從tftp下載
rommon>dir flash: ;查看快閃記憶體內容
rommon>boot ;引導IOS

靜態路由:
ip route <ip-address> <subnet-mask> <gateway> ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;靜態路由舉例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默認路由舉例

動態路由:
router(config)#ip routing ;啟動路由轉發
router(config)#router rip ;啟動RIP路由協議。
router(config-router)#network <netid> ;設置發布路由
router(config-router)#negihbor <ip> ;點對點幀中繼用。

幀中繼命令:
router(config)#frame-relay switching ;使能幀中繼交換
router(config-s0)#encapsulation frame-relay ;使能幀中繼
router(config-s0)#fram-relay lmi-type cisco ;設置管理類型
router(config-s0)#frame-relay intf-type DCE ;設置為DCE
router(config-s0)#frame-relay dlci 16 ;
router(config-s0)#frame-relay local-dlci 20 ;設置虛電路號
router(config-s0)#frame-relay interface-dlci 16 ;
router(config)#log-adjacency-changes ;記錄鄰接變化
router(config)#int s0/0.1 point-to-point ;設置子介面點對點
router#show frame pvc ;顯示永久虛電路
router#show frame map ;顯示映射

基本訪問控制列表:
router(config)#access-list <number> permit|deny <source_ip> <wild|any>
router(config)#interface <interface> ;default:deny any
router(config-if)#ip access-group <number> in|out ;default:out

例1:
router(config)#access-list 1 deny host 10.65.1.1
router(config)#access-list 1 permit any
router(config)#int f0/0
router(config-if)#ip access-group 4 in

例2:
router(config)#access-list 4 permit 10.8.1.1
router(config)#access-list 4 deny 10.8.1.0 0.0.0.255
router(config)#access-list 4 permit 10.8.0.0 0.0.255.255
router(config)#access-list 4 deny 10.0.0.0 0.255.255.255
router(config)#access-list 4 permit any
router(config)#int f0/1
router(config-if)#ip access-group 4 in

擴展訪問控制列表:
access-list <number> permit|deny icmp <S_IP wild> <D_IP wild>[type]
access-list <number> permit|deny tcp <S_IP wild> <D_IP wild>[port]

例1:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in

例2:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out

刪除訪問控制例表:
router(config)#no access-list 102
router(config-if)#no ip access-group 101 in

路由器的nat配置
Router(config-if)#ip nat inside ;當前介面指定為內部介面
Router(config-if)#ip nat outside ;當前介面指定為外部介面
Router(config)#ip nat inside source static [p] <私有IP><公網IP> [port]
Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1
Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80
Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0
Router(config)#ip nat inside source list 1 pool p1
Router(config)#ip nat inside destination list 2 pool p2
Router(config)#ip nat inside source list 2 interface s0/0 overload
Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
Router#show ip nat translation
rotary 參數是輪流的意思,地址池中的IP輪流與NAT分配的地址匹配。
overload參數用於PAT 將內部IP映射到一個公網IP不同的埠上。

外部網關協議配置
routerA(config)#router bgp 100
routerA(config-router)#network 19.0.0.0
routerA(config-router)#neighbor 8.1.1.2 remote-as 200

配置PPP驗證:
RouterA(config)#username <RouterB> password <word>
RouterA(config)#int s0
RouterA(config-if)#ppp authentication {chap|pap}

4. 路由器nat配置命令

1. 什麼是NAT?
NAT即Network Address Translation,它可以讓那些使用私有地址的內部網路連接到Internet或其它IP網路上。NAT路由器在將內部網路的數據包發送到公用網路時,在IP包的報頭把私有地址轉換成合法的IP地址。
2.在NAT實驗中需要理解的術語:
1) 內部局部地址(Inside Local):在內部網路中分配給主機的私有IP地址。
2) 內部全局地址(Inside Global):一個合法的IP地址,它對外代表一個或多個內部局部IP地址。
3) 外部全局地址(Outside Global):由其所有者給外部網路上的主機分配的IP地址。
4) 外部局部地址(Outside Local):外部主機在內部網路中表現出來的IP地址。
3.NAT的優點和缺點:
NAT的優點:
(1) 對於那些家庭用戶或者小型的商業機構來說,使用NAT可以更便宜,更有效率地接入Internet。
(2) 使用NAT可以緩解目前全球IP地址不足的問題。
(3) 在很多情況下,NAT能夠滿足安全性的需要。
(4) 使用NAT可以方便網路的管理,並大大提高了網路的適應性。
NAT的缺點:
(1) NAT會增加延遲,因為要轉換每個數據包包頭的IP地址,自然要增加延遲.
(2) NAT會使某些要使用內嵌地址的應用不能正常工作.

4.NAT的工作原理:
當內部網路中的一台主機想傳輸數據到外部網路時,它先將數據包傳輸到NAT路由器上,路由器檢查數據包的報頭,獲取該數據包的源IP信息,並從它的NAT映射表中找出與該IP匹配的轉換條目,用所選用的內部全局地址(全球唯一的IP地址)來替換內部局部地址,並轉發數據包。
當外部網路對內部主機進行應答時,數據包被送到NAT路由器上,路由器接收到目的地址為內部全局地址的數據包後,它將用內部全局地址通過NAT映射表查找出內部局部地址,然後將數據包的目的地址替換成內部局部地址,並將數據包轉發到內部主機。
5.NAT配置中的常用命令:
ip nat {inside|outside}:介面配置命令。以在至少一個內部和一個外部介面上啟用NAT。
ip nat inside source static local-ip global-ip:全局配置命令。在對內部局部地址使用靜態地址轉換時,用該命令進行地址定義。
access-list access-list-number {permit|deny} local-ip-address:使用該命令為內部網路定義一個標準的IP訪問控制列表。
ip nat pool pool-name start-ip end-ip netmask netmask [type rotary]:使用該命令為內部網路定義一個NAT地址池。
ip nat inside source list access-list-number pool pool-name [overload]:使用該命令定義訪問控制列表與NAT內部全局地址池之間的映射。
ip nat outside source list access-list-number pool pool-name [overload]:使用該命令定義訪問控制列表與NAT外部局部地址池之間的映射。
ip nat inside destination list access-list-number pool pool-name:使用該命令定義訪問控制列表與終端NAT地址池之間的映射。
show ip nat translations:顯示當前存在的NAT轉換信息。
show ip nat statistics:查看NAT的統計信息。
show ip nat translations verbose:顯示當前存在的NAT轉換的詳細信息。
debug ip nat:跟蹤NAT操作,顯示出每個被轉換的數據包。
Clear ip nat translations *:刪除NAT映射表中的所有內容。

5. 常用Cisco交換機 路由器命令

我也在學習這個 。我覺得我看的這個還行你復制下慢慢看吧
計算機命令:
PCA login: root ;使用root用戶
password: linux ;口令是linux
# shutdown -h now ;關機
# init 0 ;關機
# logout
# login
# ifconfig ;顯示IP地址
# ifconfig eth0 <ip address> netmask <netmask> ;設置IP地址
# ifconfig eht0 <ip address> netmask <netmask> down ; 刪除IP地址
# route add 0.0.0.0 gw <ip>
# route del 0.0.0.0 gw <ip>
# route add default gw <ip> ;設置網關
# route del default gw <ip> ;刪除網關
# route ;顯示網關
# ping <ip>
# telnet <ip> ;建立telnet之前先ping一下

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
交換機基本狀態:
switch: ;ROM狀態, 路由器是
rommon>
hostname> ;用戶模式
hostname# ;特權模式
hostname(config)# ;全局配置模式
hostname(config-if)# ; 介面狀態

交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname <hostname> ;設置交換機的主機名
switch(config)#enable secret xxx ;設置特權加密口令為 xxx
switch(config)#enable password xxx ;設置特權非密口令為 xxx
switch(config)#line console 0 ;進控制台口(Rs232)初始化
switch(config-line)#line vty 0 4 ;進入虛擬終端virtual tty
switch(config-line)#login ;允許登錄
switch(config-line)#password xx ;設置登錄口令xx
switch#exit ;返回命令

交換機VLAN設置:
switch#vlan database ;進入VLAN設置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入埠1
switch(config-if)#switchport access vlan 2 ;當前埠1加入VLAN 2
switch(config-if)#switchport mode trunk ;設置為干線

交換機設置IP地址:
switch(config)#interface vlan 1 ;進入vlan 1
switch(config-if)#ip address <IP> <mask> ;添加遠程登錄IP
switch(config)#ip default-gateway <IP> ;添加默認網關
switch#dir flash: ;查看內存

交換機顯示命令:
switch#write ;寫入保存
switch#show run ;查看當前配置信息
switch#show vlan ;看VLAN
switch#show interface ;顯示所有埠信息
switch#show int f0/0 ;顯示埠0的信息
switch#reload ;重新起動

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
路由器顯示命令:
router#show run ;顯示介面
router#show interface ;顯示介面
router#show ip route ;顯示路由
router#show cdp nei ;看阾居

設置口令:
router>enable ;進入特權模式
router#config terminal ;進入全局配置模式
router(config)#hostname <hostname> ;設置交換機的主機名
router(config)#enable secret xxx ;設置特權加密口令為 xxx
router(config)#enable password xxx ;設置特權非密口令為 xxx
router(config)#line console 0 ;進控制台口(Rs232)初始化
router(config-line)#line vty 0 4 ;進入虛擬終端virtual tty
router(config-line)#login ;允許登錄
router(config-line)#password xx ;設置登錄口令xx
router(config)# (Ctrl+z) ; 返回特權模式
router#exit ;返回命令

配置IP地址:
router(config)#int s0/0 ;進行串Serail介面
router(config-if)#no shutdown ;起動介面
router(config-if)#clock rate 64000 ;設置時鍾
router(config-if)#ip address 10.1.1.1 255.255.0.0 ;設置IP地址和子網掩碼
router(config-if)#ip add 10.1.1.2 255.255.0.0 second;
router(config-if)#int f0/0.1 ; 進入子介面
router(config-subif.1)#ip address <ip><netmask> ;
router(config-subif.1)#encapsulation isl <n> ;
router(config)#config-register 0x2142 ;跳過配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引導

復制操作:
router# running-config startup-config ;存配置
router# running-config tftp ;上載
router# startup-config tftp
router# tftp flash: ;特權模式下升級IOS
router# tftp startup-config ;下載配置文件到nvram

ROM狀態:
Ctrl+Break ;進入ROM監控狀態
rommon>confreg 0x2142 ;跳過配置,26 36 45xx
rommon>confreg 0x2102 ;使用配置,恢復工作狀態
rommon>reset ;重新引導,等效於重開機
rommon> xmodem:<sname> flash:<dname> ;從console升級IOS

rommon>ip_address=10.65.1.100 ;設置路由器IP (默認埠)
rommon>ip_subnet_mask=255.255.0.0 ;設置路由器掩碼
rommon>tftp_server=10.65.1.48 ;指定TFTP伺服器IP
rommon>tftp_file=c2600.T ;所要下載的文件
rommon>tftpdnld ;ROM監控狀態下升級IOS
rommon>dir flash: ;查看快閃記憶體中的內容
rommon>boot ;引導IOS

靜態路由:
ip route <ip-address> <subnet-mask> <gateway> 例:
router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2

動態路由:
router(config)#ip routing ;啟動路由
router(config)#router rip ;啟動RIP路由協議。
router(config-router)#network <netid> ;配置范圍,有的支持all。
router(config-router)#negihbor <ip-address> ;點對點 幀中繼用。

幀中繼命令:
router(config)# frame-relay switching ;使能幀中繼交換
router(config-s0)# encapsulation frame-relay ;使能幀中繼
router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虛電路)
router(config-s0)# frame-relay local-dlci 20 ;配置虛電路號

基本訪問控制列表:
router(config)#access-list <number> permit|deny <source ip> <wild|any>
router(config)#interface <interface> ;default: deny any
router(config-if)#ip access-group <number> in|out ;default: out

例:
RB(config)#access-list 4 permit 10.8.1.1
RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255
RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255
RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255
RB(config)#access-list 4 permit any
RB(config)#int f0/0
RB(config-if)#ip access-group 4 in

擴展訪問控制列表:
access-list <number> permit|deny icmp <SourceIP wild> <destinationIP
wild>[type]
access-list <number> permit|deny tcp <SourceIP wild> <destinationIP
wild>[port]
例1:
router(config)# access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)# access-list 101 permit ip any any
router(config)# int s0/0
router(config-if)#ip access-group 101 in
例2:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out

router(config)#no access-list 102
router(config-if)#no ip access-group 101 in

6. 誰能說一下這個命令有什麼用 static (neinei,DMZ) 192.168.100.0 192.168.100.0 netmask 255.255.255.0

static主要用在對外提供應用訪問。
static (neinei,DMZ) 192.168.100.0 192.168.100.0 netmask 255.255.255.0應該是
static (inside,DMZ) 192.168.100.0 192.168.100.0
兩個地址重復,企業網DMZ區域和內網地址重復了。應該是不一樣的。
這句的意思是在訪問內網地址192.168.100.0(第一個)的時候,訪問被重定向到192.168.100.0(第二個)。

7. linux打開網路配命令

ifconfig [網路設備][down up -allmulti -arp -promisc][add<地址>][del<地址>][<hw<網路設備類型><硬體地址>][io_addr<I/O地址>][irq<IRQ地址>][media<網路媒介類型>][mem_start<內存地址>][metric<數目>][mtu<位元組>][netmask<子網掩碼>][tunnel<地址>][-broadcast<地址>][-pointopoint<地址>][IP地址]

補充說明:ifconfig可設置網路設備的狀態,或是顯示目前的設置。

參數:
add<地址> 設置網路設備IPv6的IP地址。
del<地址> 刪除網路設備IPv6的IP地址。
down 關閉指定的網路設備。
<hw<網路設備類型><硬體地址> 設置網路設備的類型與硬體地址。
io_addr<I/O地址> 設置網路設備的I/O地址。
irq<IRQ地址> 設置網路設備的IRQ。
media<網路媒介類型> 設置網路設備的媒介類型。
mem_start<內存地址> 設置網路設備在主內存所佔用的起始地址。
metric<數目> 指定在計算數據包的轉送次數時,所要加上的數目。
mtu<位元組> 設置網路設備的MTU。
netmask<子網掩碼> 設置網路設備的子網掩碼。
tunnel<地址> 建立IPv4與IPv6之間的隧道通信地址。
up 啟動指定的網路設備。
-broadcast<地址> 將要送往指定地址的數據包當成廣播數據包來處理。
-pointopoint<地址> 與指定地址的網路設備建立直接連線,此模式具有保密功能。
-promisc 關閉或啟動指定網路設備的promiscuous模式。
[IP地址] 指定網路設備的IP地址。
[網路設備] 指定網路設備的名稱。

netconfig(這是Slackware發行版內附程序)
功能說明:設置網路環境。它具有互動式的問答界面,讓用戶輕易完成網路環境的設置。

8. IP、network、netmask、Broadcast作用簡單點說明。還有電信提供的,跟我們電腦自己設置的IP有什麼不同點

IP網路地址身份標識 分為內網和外網 這個要網路看DHCP和 埠聚合技術了。

NETmask 子網掩碼 分割網段用的,broadcast 廣播 運行網路協議時用的,電信提供的是外網IP地址。

內網 192.168.x.x 給這個地址所在的路由器發到目的地址,然後目的地址發信息回來 還給這個路由 路由查路由表再發回。

(8)netmask命令擴展閱讀:

首先注意,路由網關處必須設置可以配置靜態IP或者使用指定IP綁定MAC才可以配置,否則配置不成功,不要盲目的配置

網路配置的配置文件在/etc/sysconfig/network-scripts/下,文件名前綴為ifcfg-後面跟的就是網卡的名稱,可以通過雙TAB鍵查看然後編輯,也可以使用ifconfig查看,也可以使用命令:ls/etc/sysconfig/network-scripts/ifcfg-*列出所有的設備配置文件,

比如這里就是ifcfg-eno16777984這個文件,ifcfg-lo是本地回環地址的配置文件。

現在使用:vim /etc/sysconfig/network-scripts/ifcfg-eno16777984打開配置文件進行編輯,默認情況是dhcp動態獲取的。

9. ip nat pool net119 119.1.1.1 119.1.1.1 netmask 255.255.255.252 什麼意思

您好!不知道您這是哪種設備中看到的命令行,不過通常來說,這行命令的意思是做地址轉換。地址池的名稱是net119,地址池中的外部地址只有一個,是119.1.1.1,因為起止地址是相同的,另外,掩碼為255.255.255.252.

僅供參考。

10. 在Linux下如何實現使用腳本語言,把interface里的網卡信息的ip netmask gat

你的意思是說如何查看linux的IP地址么!雖然我學過這些東西,你這樣說還真會蒙住一些人的,這些都是正確答案

linux下配置ip地址四種方法:

(1)Ifconfig命令

第一種使用ifconfig命令配置網卡的ip地址。此命令通常用來零時的測試用,計算機啟動後

ip地址的配置將自動失效。具體用法如下。Ipconfig ethx ipadd netmask x.x.x.x。

其中ethx中的x代表第幾快乙太網卡,默認第一塊為0.ipadd代表ip地址。x.x.x..x為子網掩碼。例如給網卡eth0配置的ip地址為192.168.1.1 子網掩碼為 255.255.255.0 。如下下圖所

閱讀全文

與netmask命令相關的資料

熱點內容
寶可夢做解壓視頻 瀏覽:602
威綸通觸摸屏編譯時內存不足 瀏覽:614
單片機採集電壓比較 瀏覽:956
程序員三年前工資多少 瀏覽:712
pc端c語言編譯工具 瀏覽:27
護理知識app怎麼做 瀏覽:34
我的世界伺服器如何跨版本 瀏覽:937
益盟正版主力識別公式源碼 瀏覽:496
溫州程序員兼職網站 瀏覽:726
csgo控制台命令大全指令表 瀏覽:738
小米盒子連接伺服器地址 瀏覽:374
文檔怎麼壓縮進一個文件夾 瀏覽:92
cnn新聞app從哪裡下載 瀏覽:75
殺戮命令精通 瀏覽:901
如何查魔獸世界角色在哪個伺服器 瀏覽:51
壓縮氣罐免責說明 瀏覽:936
為什麼sim連接不了伺服器 瀏覽:41
如何注冊豆瓣app 瀏覽:563
屏膜找圖演算法 瀏覽:543
我的世界伺服器怎麼給別人游戲幣 瀏覽:966