通信人家园
标题:
华为5700自己摸索命令配置及与ros路由器的对接
[查看完整版帖子]
[打印本页]
时间:
2017-11-8 21:07
作者:
sdwfzcj
标题:
华为5700自己摸索命令配置及与ros路由器的对接
批量配置VLAN及上网方式
1.配置Switch
进入配置模式
<HUAWEI> system-view
修改交换机名字
[HUAWEI] sysname Switch
打开telnet模式
[Switch]telnet server enable
设置远程登录用户相关
[Switch] user-interface vty 0 4
[Switch-ui-vty0-4] authentication-mode aaa
[Switch-ui-vty0-4]protocal inbound all
[Switch-ui-vty0-4] user privilege level 15
[Switch-ui-vty0-4]quit
[Switch] aaa
[Switch-aaa] local-user admin password simple 2808 《设置密码为2808》
[Switch-aaa] local-user admin service-type telnet
[Switch-aaa] local-user admin privilege level 15
[Switch-aaa] quit
<Switch> save all
# 创建VLAN 10/20/30
[Switch] vlan batch 10 20 30
# 配置接口加入VLAN
[Switch]port-group 10 <新增组10>
[Switch-port-group-1]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/10 <组1的成员是g1到g10>
[Switch-port-group-1]port link-type access <设置为access模式>
[Switch-port-group-1]port default vlan 10 <加入vlan10>
[Switch-port-group-1]quit
[Switch]port-group 20 <新增组20>
[Switch-port-group-1]group-member GigabitEthernet 0/0/11 to GigabitEthernet 0/0/23 <组1的成员是g11到g23)
[Switch-port-group-1]port link-type access <设置为access模式>
[Switch-port-group-1]port default vlan 20 <加入vlan20>
[Switch-port-group-1]quit
[Switch]interface gigabitethernet 0/0/24
[Switch-GigabitEthernet0/0/24]description To router
[Switch-GigabitEthernet0/0/24]port link-type trunk
[Switch-GigabitEthernet0/0/24] undo port trunk allow-pass vlan 1
[Switch-GigabitEthernet0/0/24] port trunk allow-pass vlan 30
# 配置VLANIF接口的IP地址
[Switch] interface vlanif 10
[Switch-Vlanif10] ip address 192.168.50.1 24
[Switch-Vlanif10] quit
[Switch] interface vlanif 20
[Switch-Vlanif20] ip address 192.168.60.1 24
[Switch-Vlanif20] quit
[Switch] interface vlanif 30 <管理vlan>
[Switch-Vlanif30] ip address 192.168.70.1 24
[Switch-Vlanif30] quit
[Switch]ip route-static 0.0.0.0 0.0.0.0 192.168.70.254 <5720的上一级路由器的IP>
[Switch]save all
[Switch]quit
[Switch]reboot
把ros连接的网卡 增加vlan 30
增加vlan 30 IP设置为192.168.70.254
增加回程路由 192.168.60.0/24 gateway 192.168.70.1
通信人家园 (https://www.txrjy.com/)
Powered by C114