华为eNSP模拟器:AC初始化配置:使用Telnet实现远程登录AC,进行管理。

1、配置 AP 管理 vlan 100
步骤 1:AP2050配置静态IP地址10.1.100.66 和网关10.1.100.1,同时设置 AC 的地址为10.1.100.2,然后重启生效。

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]ap-address mode static
Info: The configuration takes effect after the AP is restarted.
[Huawei]ap-address static ip-address 10.1.100.66 24 10.1.100.1
Info: The configuration takes effect after the AP is restarted.
[Huawei]ap-address static ac-list 10.1.100.2
Info: The configuration takes effect after the AP is restarted.
[Huawei]quit
<Huawei>reboot

步骤 2:配置S5700 ,创建 vlan 100,设置 G0/0/2 为 trunk, 端 口的 PVID 为 vlan 100,设置 G0/0/01 为 trunk, vlan 100 虚接口 IP 地址为 10.1.100.1。
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[S5700]vlan 100
[S5700-vlan100]quit    
[S5700]interface GigabitEthernet 0/0/2 
Dec 15 2023 20:36:16-08:00 S5700 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
25.191.3.1 configurations have been changed. The current change number is 7, the
 change loop count is 0, and the maximum number of records is 4095.
[S5700-GigabitEthernet0/0/2]port link-type trunk
[S5700-GigabitEthernet0/0/2]port trunk pvid vlan 100    
[S5700-GigabitEthernet0/0/2]port trunk allow-pass vlan all 
[S5700-GigabitEthernet0/0/2]quit
[S5700]interface GigabitEthernet 0/0/1
[S5700-GigabitEthernet0/0/1]port link-type trunk     
[S5700-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[S5700-GigabitEthernet0/0/1]quit
[S5700]interface Vlanif 100
Dec 15 2023 20:39:17-08:00 S5700 %%01IFNET/4/IF_STATE(l)[55]:Interface Vlanif100
 has turned into UP state.
[S5700-Vlanif100]ip address 10.1.100.1 24
Dec 15 2023 20:39:30-08:00 S5700 %%01IFNET/4/LINK_STATE(l)[56]:The line protocol
 IP on the interface Vlanif100 has entered the UP state.
[S5700-Vlanif100]quit
步骤 3: 配置AC6005 ,创建vlan 100,并设置 G0/0/1 为 trunk,并配置vlan 100 虚接口的 IP 地址为 10.1.100.2。

<AC6005>system-view 
Enter system view, return user view with Ctrl+Z.
[AC6005]vlan 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[AC6005-vlan100]quit
[AC6005]interface GigabitEthernet 0/0/1
[AC6005-GigabitEthernet0/0/1]port link-type trunk     
[AC6005-GigabitEthernet0/0/1]port trunk allow-pass vlan all 
[AC6005-GigabitEthernet0/0/1]quit
[AC6005]interface vlan 100
[AC6005-Vlanif100]ip address 10.1.100.2 24
[AC6005-Vlanif100]quit

验证:在AP上ping通 10.1.100.1、10.1.100.2
[Huawei]ping 10.1.100.1
  PING 10.1.100.1: 56  data bytes, press CTRL_C to break
    Reply from 10.1.100.1: bytes=56 Sequence=1 ttl=255 time=70 ms
    Reply from 10.1.100.1: bytes=56 Sequence=2 ttl=255 time=10 ms
    Reply from 10.1.100.1: bytes=56 Sequence=3 ttl=255 time=10 ms
    Reply from 10.1.100.1: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.1.100.1: bytes=56 Sequence=5 ttl=255 time=10 ms

  --- 10.1.100.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/24/70 ms
[Huawei]ping 10.1.100.2
  PING 10.1.100.2: 56  data bytes, press CTRL_C to break
    Reply from 10.1.100.2: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 10.1.100.2: bytes=56 Sequence=2 ttl=255 time=40 ms
    Reply from 10.1.100.2: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 10.1.100.2: bytes=56 Sequence=4 ttl=255 time=20 ms
    Reply from 10.1.100.2: bytes=56 Sequence=5 ttl=255 time=40 ms

  --- 10.1.100.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/32/40 ms

2、配置 AC 的 Telnet 服务
步骤:远程 Telnet 采用 AAA 认证方式(用户名+密码)
步骤 1:启动 TeInet 服务,配置本地用户 huawei,密码为 huawei123,用户服务类型为TeInet,并设置用户的管理级别为 15 级,并进入 VTY 用户接口,设置认证方式为 aaa,VTY 入口协议为 Telnet。
[AC6005]telnet server enable 
Info: TELNET server has been enabled.
[AC6005]aaa    
[AC6005-aaa]local-user huawei password cipher huawei123
Info: Add a new user.
[AC6005-aaa]local-user huawei service-type telnet
Info: The cipher password has been changed to an irreversible-cipher password.
Warning: The user access modes include Telnet, FTP, or HTTP, so security risks e
xist.
Info: After changing the rights (including the password, access type, FTP direct
ory, HTTP directory, and level) of a local user, the rights of users already onl
ine do not change. The change takes effect to users who go online after the chan
ge.    
[AC6005-aaa]local-user huawei privilege level 15
Warning: This operation may affect online users, are you sure to change the user
 privilege level ?[Y/N]y
[AC6005-aaa]quit    
[AC6005]user-interface vty 0 4
[AC6005-ui-vty0-4]authentication-mode aaa
Warning: The level of the user-interface(s) will be the default level of AAA use
rs, please check whether it is correct.
[AC6005-ui-vty0-4]protocol inbound telnet 
Warning: The inbound protocol include Telnet, so security risks exist.
验证 :在 AP上,使用命令 telnet 10.1.100.2,可以远程登录到 AC。

<Huawei>telnet 10.1.100.2
  Press CTRL_] to quit telnet mode
  Trying 10.1.100.2 ...
  Connected to 10.1.100.2 ...
Warning: Telnet is not a secure protocol, and it is recommended to use Stelnet.

Login authentication


Username:huawei
Password:
<AC6005>

显示登录成功。

以下是一个基于栈的出栈序列检查的C语言代码: ```c #include <stdio.h> #include <stdlib.h> #define MAX_STACK_SIZE 100 int stack[MAX_STACK_SIZE]; int top = -1; void push(int val) { if (top == MAX_STACK_SIZE - 1) { printf("Stack overflow\n"); exit(1); } stack[++top] = val; } int pop() { if (top == -1) { printf("Stack underflow\n"); exit(1); } return stack[top--]; } int main() { int n, i, j; int push_seq[MAX_STACK_SIZE], pop_seq[MAX_STACK_SIZE]; printf("Enter the size of the sequence: "); scanf("%d", &n); printf("Enter the push sequence: "); for (i = 0; i < n; i++) { scanf("%d", &push_seq[i]); } printf("Enter the pop sequence: "); for (i = 0; i < n; i++) { scanf("%d", &pop_seq[i]); } i = 0; j = 0; while (i < n && j < n) { if (push_seq[i] == pop_seq[j]) { i++; j++; } else if (top != -1 && stack[top] == pop_seq[j]) { pop(); j++; } else { push(push_seq[i++]); } } while (top != -1 && j < n) { if (stack[top] == pop_seq[j]) { pop(); j++; } else { break; } } if (top == -1 && j == n) { printf("The pop sequence is valid.\n"); } else { printf("The pop sequence is not valid.\n"); } return 0; } ``` 该程序要求用户输入一个序列的大小,一个压栈序列和一个出栈序列。然后,程序使用一个基于栈的算法来检查出栈序列的合法性。如果出栈序列是合法的,程序将输出“ The pop sequence is valid.”,否则输出“The pop sequence is not valid.”。 该算法的基本思想是模拟压栈和出栈过程。我们从压栈序列的开头开始遍历,遇到一个和出栈序列的当前元素相等的元素时,我们将它出栈。否则,我们将该元素压入栈中。如果栈顶元素和出栈序列的当前元素相等,则将栈顶元素出栈。 在遍历完压栈序列后,我们检查栈中剩余的元素是否可以与出栈序列中的元素匹配。如果可以,则弹出栈顶元素并移动到下一个出栈元素。如果不能匹配,则出栈序列无效。 此算法的时间复杂度为O(n),其中n为序列的大小。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值