Files
test/MacVlan.md

84 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

2025-03-03 15:34:05 +08:00
``` js
//const response = data.toString();
// console.info(response);
if (isConnected && !hasSentCommand && response.includes(serveName)) {
hasSentCommand = true;
counter = 10;
// 发送命令
// const args = process.argv.slice(2);
rl.question('Command:', (args) => {
// TODO: Log the answer in a database
console.log('发送命令:', args);
client.write(`${args} \n`);
rl.close();
});
}
if (response.includes('Current Tempr')) {
// 提取温度值
tem = parseFloat(response.split(':')[1].trim());
console.log('当前温度:', tem);
client.end();
}
if (response.includes('VLAN Name')) {
// 转换为 JSON
const parsedData = parseResponse(response);
const jsonData = JSON.stringify(parsedData, null, 2);
console.log('JSON 数据:', jsonData);
client.end();
}
```
2025-03-03 15:35:21 +08:00
``` shell
2025-03-03 15:34:05 +08:00
Protocol Address Age(min) Hardware Type Interface
Internet 10.80.1.1 -- 0069.2cb3.16a3 arpa VLAN 1
Internet 10.80.1.20 0 11ea.c723.f0ef arpa VLAN 1
2025-03-03 15:35:21 +08:00
# 端口信息
2025-03-03 15:34:05 +08:00
port link-type hybrid
port hybrid vlan 1 untagged
mac-vlan enable
mac-vlan trigger enable
2025-03-03 15:35:21 +08:00
# MAC地址信息
2025-03-03 15:34:05 +08:00
[H3C]dis mac-address
MAC Address VLAN ID State Port/Nickname Aging
0000-0000-0447 1 Learned GE1/0/18 Y
c617-f33c-71d4 1 Learned GE1/0/2 Y
2025-03-03 15:35:21 +08:00
# MAC-VLAN信息
2025-03-03 15:34:05 +08:00
[H3C]dis mac-vlan all
The following MAC VLAN entries exist:
State: S - Static, D - Dynamic
MAC address Mask VLAN ID Dot1p State
0000-0000-0447 ffff-ffff-ffff 110 0 S
c617-f33c-71d4 ffff-ffff-ffff 100 0 S
Total MAC VLAN entries count: 2
2025-03-03 15:35:21 +08:00
# DHCP服务
2025-03-03 15:34:05 +08:00
[H3C-dhcp-pool-vlan100]dis this
#
dhcp server ip-pool vlan100
gateway-list 10.8.100.1
network 10.8.100.0 mask 255.255.255.0
dns-list 223.5.5.5
static-bind ip-address 10.8.100.8 mask 255.255.255.0 hardware-address c617-f33c-71d4
#
return
```
dynamic html streaming