华为ENSP
一:
1) DHCP自动分配IP地址
第一种方法
[sw1]int vlan 10
[sw1-Vlanif10]ip add 192.168.10.1 24
[sw1]dhcp enable
[sw1]int vlan 10
[sw1-Vlanif10]dhcp select interface
[sw1-Vlanif10]dhcp server dns-list 1.1.1.1
第二种方法
vlan batch 10 20 100
dhcp enable
ip pool v10
gateway-list 192.168.10.1
network 192.168.10.0 mask 255.255.255.0
dns-list 2.2.2.2
interface Vlan 10
dhcp select global
2) 设置VLAN
第一种方法
[sw3]vlan bat 10 20 30
[sw3]int e0/0/10
[sw3-Ethernet0/0/10]port link-type access
[sw3-Ethernet0/0/10]port default vlan 10
[sw3-Ethernet0/0/3]in e0/0/5
[sw3-Ethernet0/0/5]port link-type trunk
[sw3-Ethernet0/0/5]port trunk allow-pass vlan 10 20 30
第二种方法
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]port hybrid pvid vlan 20
[sw2-Ethernet0/0/2]port hybrid untagged vlan 20
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]port hybrid pvid vlan 20
[sw2-Ethernet0/0/2]port hybrid tagged vlan 20
3) 做RIP
[sw1]rip
[sw1-rip-1]version 2
[sw1-rip-1]undo summary
[sw1-rip-1]network 192.168.10.0
[sw1-rip-1]network 192.168.20.0
[sw1-rip-1]network 192.168.30.0
[sw1-rip-1]net 11.0.0.0
4) 接口设置IP---路由器
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 11.0.0.1 24
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 12.0.0.1 24
5) 开启远程登录-----交换机
[sw1]user-interface vty 0 4
[sw1-ui-vty0-4]authentication-mode aaa
[sw1-aaa]local-user sw1 password cipher 123456 privilege level 3
[sw1-aaa]local-user sw1 service-type telnet
6) 路由器开启Telnet
[r2]user-interface vty 0 4
[r2-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):123456
7) 设置ACL
[r1]acl name r1 2001 #设置acl名称及序列号
[r1-acl-basic-r1]rule 5 permit source 192.168.10.0 0.0.0.0
[r1]user-interface vty 0 4
[r1-ui-vty0-4]acl 2001 inbound #在接口上应用acl规则
[R2]acl name r2 2002
[R2-acl-basic-r2]rule 5 permit source 192.168.10.0 0.0.0.0
[R2-ui-vty0-4]acl 2002 inbound
8) OSPF
R1(config)#router ospf 110
R1(config-router)#network 12.0.0.0 0.0.0.255 area 1
R1(config-router)#network 192.168.10.0 0.0.0.255 area 1
9) VRRP----路由器
interface GigabitEthernet0/0/1.10
dot1q termination vid 10
ip address 192.168.10.10 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.10.1
vrrp vrid 1 priority 120
vrrp vrid 1 track interface GigabitEthernet0/0/0
arp broadcast enable
10)链路捆绑及TRUNK
第一种方法
[sw2]int Eth-Trunk 1
[sw2-Eth-Trunk1]int e0/0/10
[sw2-Ethernet0/0/10]eth-trunk 1
[sw2-Ethernet0/0/10]int e0/0/11
[sw2-Ethernet0/0/11]eth-trunk 1
[sw2]dis eth-trunk 1
PortName Status Weight
Ethernet0/0/10 Up 1
Ethernet0/0/11 Up 1
第二种方法
11)做映射代理
[sw1-Vlanif30]int vlan 30
[sw1-Vlanif30]dhcp select relay
[sw1-Vlanif30]dhcp relay server-ip 23.0.0.3