静态路由:
route-static 192.168.12.1 24 192.168.13.1
interface g0/0/1
ip address 192.168.1.1 24
rip协议:
rip 1
version 2
network 192.168.1.0
summary always version 2版本手动开启路由汇总
ospf协议:
ospf 1
ospf 1 router-id 1.1.1.1
area 0
network 192.168.23.0 0.0.0.255
stub 末梢区域
stub no-summary 完全末梢区域
nssa 非完全末梢区域
nssa no-summary 完全非完全末梢区域
vlink-peer 4.4.4.4
vlink-peer 5.5.5.5
reset ospf 1 process 刷新ospf 1 的进程
bgp协议:
bgp 300
bgp 200
bgp 100
router-id 1.1.1.1
peer 1.1.1.1 as-number 100 as不同就是EBGP
peer 1.1.1.1 connect-interface loopback 0
peer 1.1.1.1 next-hop-local 告诉1.1.1.1下一跳是自己
reset bgp all 刷新bgp进程
vrrp虚拟路由:
interface g0/0/1
vrrp vrid virtual-ip xxxxxxxxxxxxxxxx
vrrp vrid 1 priority 110 vrrp默认100优先级
vrrp vrid track interface g0/0/0 reduced 20 监控0/0/0口,无法通过降20优先级
DHCP动态获取ip协议:
dhcp enable
ip pool net1
network xxxxxxxxxxx mask 255.255.255.0
gateway-list xxxxxxxxxx
dns-list xxxx
lease day x hour x mintue x
static-bind ip-address xxxxxxxxx mac-address xxxx-xxxx-xxxx
interface g0/0/1
dhcp select global
interface g0/0/2
dhcp select interface
dhcp server + 全局模式的命令 相比全局模式不需要配网关
ACL规则:
acl 2000
rule permit/deny source 192.168.54.0 0.0.0.255
inter g0/0/1
traffic-filter out/inbound acl 2000
acl 3000
rule permit/deny tcp source 192.168.33.0 0.0.0.255 destination 201.168.21.2 destination-port eq 80 允许192.168.33.0网段访问目标IP/网段 201.168.21.2的80端口
rule permit/deny ip source 192.168.3.0 0.0.0.255 destination 192.168.54.0 0.0.0.255 允许192.168.3.0网段访问192.168.54.0网段
interface g0/0/1
traffic-filter out/inbound acl 3000
四种nat技术:
nat static global xxxxxxxxxxxxx inside xxxxxxxxxxxx 静态
nat address-group 1 xxxxxxxxxxx xxxxxxxxxxxx
acl 2000
rule permit source xxxxxxxxxx 0.0.0.255 允许某内网网段
interface g0/0/1
nat outbound 2000 address-group 1 no-pat 该接口在出去的时候nat转换调用acl 2000
不加no-pat是NAPT,加了是动态
acl 2000 Easy ip
rule permit source xxxxxxxxxxxx 0.0.0.255
inter g0/0/2
nat outbound 2000
inter g0/0/3
nat server protrocol tcp/别的协议 global xxxxxxxxxx 80/其他协议端口号 inside xxxxxxxx 80
vlan,access,trunk,hybrid命令:
vlan batch 10 20
p l t
p t a v 10 20
p l a
p d a v 10
p h pvid vlan 10
p h tagged vlan 10 20
p h untagged vlan 10 20
stp生成树命令:
stp region-configuration 华为设备默认mstp
region-name xxxx
instance 1 vlan 10
instance 2 vlan 20
active region-configuration 到这一步stp设置好了
q
stp instance 1 root primary 设置优先级
stp instance 2 root secondary
stp生成树需要对环路的每个交换机都进行设置
没有进行实例配置时,默认所有vlan属于实例0
比如没有对vlan50,60进行实例配置,那么50,60默认实例0
单臂路由命令:
interface g0/0/0.1
ip address 192.168.1.1
dot1q termination vid 10
arp broadcast enable
三层交换机虚接口命令:
vlan batch 10 20
inter vlan 10
ip address xxxxxxxxxxxxxxxxx
路由器和交换机的链路聚合:
inter eth-trunk 1
undo portswitch 路由和交换机进行链路聚合额外输入的命令
ip address 路由进行链路聚合需要给逻辑接口配ip
mode lacp-static
trunkport e 0/0/1 to 0/0/3
trunkport e0/0/4
p l t
p t a v 10 20 30
max active-linknumber x