華為交換機基本配置命令大全
華為交換機基本配置命令大全
network 192.168.5.0 定義IP
network 192.168.3.0 定義IP
disp ip rout 查看路由接口
R2:
int e1/0 進入e1/0端口
ip address 192.168.4.1 255.255.255.0 設置IP
int e2/0 進入e2/0端口
ip adress 192.168.5.2 255.255.255.0 設置IP
rip 設置動態(tài)路由
network 192.168.5.0 定義IP
network 192.168.4.0 定義IP
disp ip rout 查看路由接口
(注意:兩臺PC機的網關設置PC1 IP:192.168.3.1 PC2 IP:192.168.4.1)
七、IP訪問列表
int e1/0
ip address 192.168.3.1 255.255.255.0
int e2/0
ip address 192.168.1.1 255.255.255.0
int e3/0
ip address 192.168.2.1 255.255.255.0
acl number 2001 (2001-2999屬于基本的訪問列表)
rule 1 deny source 192.168.1.0 0.0.0.255 (拒絕地址192.168.1.0網段的數據通過)
rule 2 permit source 192.168.3.0 0.0.0.255(允許地址192.168.3.0網段的數據通過)
以下是把訪問控制列表在接口下應用:
firewall enable
firewall default permit
int e3/0
firewall packet-filter 2001 outbound
disp acl 2001 顯示信息
undo acl number 2001 刪除2001控制列表
擴展訪問控制列表
acl number 3001
rule deny tcp source 192.168.3.0 0.0.0.255 destination 192.168.2.0 0.0.0.255 destination-port eq ftp
必須在r-acl-adv-3001下才能執(zhí)行
rule permit ip source an destination any (rule permit ip)
int e3/0
firewall enable 開啟防火墻
firewall packet-filter 3001 inbound
必須在端口E3/0下才能執(zhí)行
八、命令的標準訪問IP列表(三層交換機):
允許A組機器訪問服務器內資料,不允許訪問B組機器(服務器沒有限制)
sys
vlan 10
name server
vlan 20
name teacher
vlan 30
name student
int e1/0/5
port access vlan 10
int e1/0/10
port access vlan 20
int e1/0/15
port access vlan 30
int vlan 10
ip address 192.168.10.1 255.255.255.0
undo sh
int vlan 20
ip address 192.168.20.1 255.255.255.0
int vlan 30
ip address 192.168.30.1 255.255.255.0
acl number 2001
rule 1 deny source 192.168.30.0 0.0.0.255
rule 2 permit source any
disp acl 2001 查看2001列表
int e1/0/10
port access vlan 20
packet-filter outbound ip-group 2001 rule 1
出口
九、允許A機器訪問B機器的FTP但不允許訪問WWW,C機器沒有任何限制。
vlan 10
vlan 20
vlan 30
int e1/0/5
port access vlan 10
int e1/0/10
port access vlan 20
int e1/0/15
port access vlan 30
int vlan 10
ip address 192.168.10.1 255.255.255.0
undo sh
int vlan 20
ip address 192.168.20.1 255.255.255.0
int vlan 30
ip address 192.168.30.1 255.255.255.0
acl number 3001
rule 1 deny tcp source 192.168.30.0 0.0.0.255 destination 192.168.10.0 0.0.0.255 destination-port eq www
int e1/0/15
packet-filter inbound ip-group 3001 rule 1
進口
十、NAT地址轉換(單一靜態(tài)一對一地址轉換)
R1:
sys
sysname R1
int e1/0
ip address 192.168.3.1 255.255.255.0
int e2/0
ip address 192.1.1.1 255.255.255.0
R2:
sys
sysname R2
int e2/0
ip address 192.1.1.2 255.255.255.0
int e1/0
ip address 10.80.1.1 255.255.255.0
回到R1:
nat static 192.168.3.1 192.1.1.1
int e2/0
nat outbound static
ip route 0.0.0.0 0.0.0.0 192.1.1.2
十一、NAT內部整網段地址轉換
R1:
sys
sysname R1
int e1/0
ip address 192.168.3.1 255.255.255.0
int e2/0
ip address 192.1.1.1 255.255.255.0
acl number 2008
rule 0 permit source 192.168.3.0 0.0.0.255
rule 1 deny
quit
int e2/0
nat outbound 2008
quit
ip route-static 0.0.0.0 0.0.0.0 192.1.1.2 preference 60
↑
下一個路由接口地址
R2:
sys
版權聲明:本文內容由互聯網用戶自發(fā)貢獻,該文觀點僅代表作者本人。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如發(fā)現本站有涉嫌抄襲侵權/違法違規(guī)的內容, 請發(fā)送郵件至 yyfangchan@163.com (舉報時請帶上具體的網址) 舉報,一經查實,本站將立刻刪除