ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

单臂路由实验配置

2021-05-14 14:05:53  阅读:116  来源: 互联网

标签:r1 vlan 192.168 interface 实验 address sw1 路由 单臂


在这里插入图片描述

Sw1:
[sw1]vlan 2
[sw1-vlan2]q //创建vlan
[sw1]vlan 3

[sw1]vlan batch 4 to 10 //批量创建vlan
[sw1]undo vlan batch 4 to 10 //删除vlan

[sw1]interface e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 2 //将端口Ethernet0/0/1划分到vlan2

[sw1]interface e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 3 //将端口Ethernet0/0/2划分到vlan3

Sw2:
[sw2]vlan batch 2 to 3
[sw2]interface e0/0/1 //创建vlan
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port default vlan 2 //将端口Ethernet0/0/1划分到vlan2
[sw2]interface e0/0/2
[sw2-Ethernet0/0/2]port default vlan 3

在两台交换机上进行trunk配置:
Sw1:
[sw1]interface e0/0/3
[sw1-Ethernet0/0/3]port link-type trunk //trunk端口设置
[sw1-Ethernet0/0/3]port trunk allow-pass vlan all //允许通过的vlan
Sw2:
[sw2]interface e0/0/3
[sw2-Ethernet0/0/3]port link-type trunk //trunk端口设置
[sw2-Ethernet0/0/3]port trunk allow-pass vlan all //允许通过的vlan

单臂路由配置:
[r1]interface g0/0/0.1 //创建虚拟子接口
[r1-GigabitEthernet0/0/0.1]ip address 192.168.1.1 24 //网关地址配置
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2 //终止子接口用于vlan 2
[r1-GigabitEthernet0/0/0.1]arp broadcast enable //启用arp的广播功能
[r1]interface g0/0/0.2 //创建虚拟子接口
[r1-GigabitEthernet0/0/0.2]ip address 192.168.2.1 24 //网关地址配置
[r1-GigabitEthernet0/0/0.2]dot1q termination vid 3 //终止子接口用于vlan 3
[r1-GigabitEthernet0/0/0.2]arp broadcast enable //启用arp的广播功能
查看虚拟子接口配置:
[r1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/0.1 192.168.1.1/24 up up
GigabitEthernet0/0/0.2 192.168.2.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned
交换机上进行trunk配置:
[sw1]interface e0/0/4
[sw1-Ethernet0/0/4]port link-type trunk
[sw1-Ethernet0/0/4]port trunk allow-pass vlan all
DHCP配置:
[r1]ip pool class_A //创建地址池class_A
Info: It’s successful to create an IP address pool.
[r1-ip-pool-class_A]network 192.168.1.0 mask 24 //所要下放的地址
[r1-ip-pool-class_A]gateway-list 192.168.1.1 //网关地址
[r1-ip-pool-class_A]dns-list 8.8.8.8 //DNS服务器地址
[r1]dhcp enable //启用dhcp服务器
Info: The operation may take a few seconds. Please wait for a moment.done.
[r1]interface g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global //dhcp的调用
[r1]ip pool class_B //创建地址池class_B
Info: It’s successful to create an IP address pool.
[r1-ip-pool-class_B]network 192.168.2.0 mask 24 //所要下放的地址
[r1-ip-pool-class_B]gateway-list 192.168.2.1 //网关地址
[r1-ip-pool-class_B]dns-list 8.8.8.8 //DNS服务器地址
[r1]interface g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dhcp select global //dhcp的调用
查看PC获取的IP地址:
Vlan 2 PC获取的IP地址:
PC 1: PC3:
PC>ipconfig PC>ipconfig
Link local IPv6 address…: fe80::5689:98ff:feaa:2f36 Link local IPv6 address…: fe80::5689:98ff:fee1:375f
IPv6 address…: :: / 128 IPv6 address…: :: / 128
IPv6 gateway…: :: IPv6 gateway…: ::
IPv4 address…: 192.168.1.254 IPv4 address…: 192.168.1.253
Subnet mask…: 255.255.255.0 Subnet mask…: 255.255.255.0
Gateway…: 192.168.1.1 Gateway…: 192.168.1.1
Physical address…: 54-89-98-AA-2F-36 Physical address…: 54-89-98-E1-37-5F
DNS server…: 8.8.8.8 DNS server…: 8.8.8.8
Vlan 2 PC获取的IP地址:
PC2: PC4:
PC>ipconfig PC>ipconfig
Link local IPv6 address…: fe80::5689:98ff:feb7:3631 Link local IPv6 address…: fe80::5689:98ff:fe07:5a48
IPv6 address…: :: / 128 IPv6 address…: :: / 128
IPv6 gateway…: :: IPv6 gateway…: ::
IPv4 address…: 192.168.2.254 IPv4 address…: 192.168.2.253
Subnet mask…: 255.255.255.0 Subnet mask…: 255.255.255.0
Gateway…: 192.168.2.1 Gateway…: 192.168.2.1
Physical address…: 54-89-98-B7-36-31 Physical address…: 54-89-98-07-5A-48
DNS server…: 8.8.8.8 DNS server…: 8.8.8.8
禁用IP地址:
[r1]ip pool class_B
[r1-ip-pool-class_B]excluded-ip-address 192.168.2.200 192.168.2.254

标签:r1,vlan,192.168,interface,实验,address,sw1,路由,单臂
来源: https://blog.51cto.com/u_15200479/2775381

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有