添加 MacVlan.md
This commit is contained in:
84
MacVlan.md
Normal file
84
MacVlan.md
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
|
||||||
|
``` 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();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
端口信息
|
||||||
|
port link-type hybrid
|
||||||
|
port hybrid vlan 1 untagged
|
||||||
|
mac-vlan enable
|
||||||
|
mac-vlan trigger enable
|
||||||
|
|
||||||
|
|
||||||
|
MAC地址信息
|
||||||
|
[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
|
||||||
|
|
||||||
|
MAC-VLAN信息
|
||||||
|
[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
|
||||||
|
|
||||||
|
DHCP服务
|
||||||
|
[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
|
||||||
Reference in New Issue
Block a user