交換機配置實例(DHCP、VLAN)
1. 端口地址配置
int g0/0/1
ip add 172.16.131.5 255.255.255.0
2. 靜態路由配置
目的IP 掩碼 下一跳
0.0.0.0 0.0.0.0 X.X.X.X
ip route-static 0.0.0.0 0.0.0.0 192.168.88.1 這條路由是所有的訪問下一跳都是88.1
ip route-static 10.10.100.0 255.255.255.0 10.10.101.1 這條路由是10.10.100.0/24這個段的訪問地址是10.10.101.1
3. DHCP、VLAN配置
1. 打開DHCP功能
DHCP enable
2. 在服務器上創建VLAN10;20;IP地址池VLAN 10和IP地址池 VLAN 20
vlan batch 10 20
ip pool vlan10
gateway-list 192.168.1.254
network 192.168.1.0 mask 255.255.255.0
lease day 3
dns-list 8.8.8.8/
ip pool VLAN20
gateway-list 192.168.2.254
network 192.168.2.0 mask 255.255.255.0
lease day 3
dns-list 8.8.8.8/
3. 給VLAN10,VLAN20配置IP。實現三層互訪
interface vlanif10
ip address 192.168.1.254 255.255.255.0
dhcp select global
interface vlanif20
ip address 192.168.2.254 255.255.255.0
dhcp select global
4. VLAN端口設置:給DHCP服務器1口和2口配置trunk鏈路
interface gi0/0/1
port link-type trunk
port trunk allow-pass all
interface gi0/0/2
port link-type trunk
port trunk allow-pass all
5. 二層交換機VLan配置:在交換機一上把端口1;2加入VLAN 10;端口3設置成trunk鏈路
vlan batch 10 20
interface gi0/1
port link-type access
port default vlan 10
interface gi0/2
port link-type access
port default vlan 10
interface gi0/3
port link-type trunk
port trunk allow-pass all
6. 端口綁定MAC、IP地址和Vlan
user-bind static ip-address 192.168.1.252 mac-address 5489-9858-4B5c interface GigabitEthernet 0/0/1 vlan 100
華為交換機端口安全詳解--端口隔離、環路檢測與端口安全
https://blog.csdn.net/xieyunc/article/details/82785340?utm_source=blogxgwz9
華為交換機綁定ip地址和MAC地址
https://jingyan.baidu.com/article/8ebacdf0f12b8d09f65cd5fb.html