文章来源地址https://www.toymoban.com/news/detail-505029.html
#家庭网络配置
#三层交换机配置
#打开HDCP功能
#进入系统视图
<Huawei>system-view
#关闭系统提示信息
[Huawei]undo info-center enable
#打开DHCP 使能
[Huawei]dhcp enable
#创建vlan 10 vlan 20 vlan 2
[Huawei]vlan batch 2 10 20
#进入 vlan 并配置ip 与 dhcp
[Huawei]int vlan 10
[Huawei-Vlanif10]ip address 192.168.10.254 24
[Huawei-Vlanif10]dhcp select interface
[Huawei]int vlan 20
[Huawei-Vlanif20]ip address 192.168.20.254 24
[Huawei-Vlanif20]dhcp select interface
[Huawei]int vlan 2
[Huawei-Vlanif20]ip address 192.168.20.254 24
#配置端口类型并加入对应的vlan
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 10
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 20
[Huawei]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 2
#配置静态路由表 0.0.0.0 0.0.0.0 为缺省路由,192.168.1.1为下一跳路由器端口IP地址
[Huawei] ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
#一层路由配置
<Huawei>system-view
#关闭系统提示信息
[Huawei]undo info-center enable
#配置端口ip
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 100.1.1.2 24
[Huawei]ip route-static 0.0.0.0 0.0.0.0 100.1.1.1
[Huawei]ip route-static 192.168.10.0 255.255.255.0 192.168.1.2
[Huawei]ip route-static 192.168.20.0 255.255.255.0 192.168.1.2
#二层路由
<Huawei>system-view
#关闭系统提示信息
[Huawei]undo info-center enable
#配置端口ip
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 100.1.1.1 24
#创建环回端口并配置IP地址
[Huawei]interface LoopBack0
[Huawei-LoopBack0]ip address 114.114.114.114 24
#添加静态环回路由表
[Huawei]ip route-static 192.168.10.0 255.255.255.0 192.168.1.2
[Huawei]ip route-static 192.168.10.0 255.255.255.0 100.1.1.2
[Huawei]ip route-static 192.168.20.0 255.255.255.0 100.1.1.2
文章来源:https://www.toymoban.com/news/detail-505029.html
到了这里,关于#家庭网络配置(华为路由与交换机)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!