本文共 25364 字,大约阅读时间需要 84 分钟。
我有个发小朋友家里在北京拆迁了,家里拿到一大笔巨额财富(曹真他妈羡慕!!)。朋友是学服装设计的就想要开一家服装设计生产公司,来设计并销售服装。朋友知道我是学习网络工程的,怀着忙腔热血找我来给他设计网络架构。我当时想拒绝的,因为我也是半吊子,东西懂得不是很多,我本着试试的态度答应给他做个网络架构拓扑。朋友告诉我他公司规模还是比较大的,有销售部、财务部、采购部、综合办、生产研发部、质管部、库房以及售后服务部。朋友告诉我员工的电脑不必要买太好的每台电脑预算在3000元左右就可以。
英特尔(Intel) i5 7500 酷睿四核 盒装CPU处理器 1399元
技嘉(GIGABYTE)H110M-DS2V主板 (Intel H110/LGA 1151) 389元酷兽(CUSO) DDR4 8G 2133台式机内存条8g 499元(现在显卡真贵了,原先才300多)铭速HD6450 2GD3战斗版625/1066MHZ 2G半高显卡刀卡独立显卡2G 标准机箱版 155 元西部数据(WD) 1TB西数蓝盘64MB7200转1T台式机电脑机械硬盘正品行货送配件 287元鑫谷(Segotep)额定500W 核动力-超级战舰F7电源(双管正激架构/主动式PFC/宽幅/背线/静音风扇/电脑电源)199元金河田(Golden field) 金河田 启航至尚A1台式机电脑玻璃机箱游戏水冷ATX 黑色半测透 109元山泽(SAMZHE)DY-01 电脑主机国标电源线 品字尾三孔电源连接线 适用电脑主机显示器电饭煲 直插1.8米 17元TCL T22M1 21.5英寸TN面板FHD全高清LED背光电脑液晶电脑显示器 518元pc机加显示是总金额3500元。性能还是不错的。华为(HUAWEI) S5700-28C-SI 24口全千兆三层交换机 含单交流电源+4端口千兆SFP 6台 单台价格7835元
华为(HAUWEI)AR3260-S 高端企业级集成路由器 2台 单台价格20087元1、vlan分配(让各个部门在二层上电脑是隔离的)
2、交换机的冗余备份。3、捆绑链路(增大带宽,实现备份冗余链路)4、vrrp实现路由器的备份冗余5、三层交换机当作DHCp使用6、使用acl的nat,转换内网ip为外网ip。部门 | 网关 | 所属vlan |
---|---|---|
财务部 | 192.168.10.254 | vlan10 |
综合办 | 192.168.20.254 | vlan20 |
售后服务部 | 192.168.30.254 | vlan30 |
库房 | 192.168.40.254 | vlan40 |
质管部 | 192.168.50.254 | vlan50 |
生产研发部 | 192.168.60.254 | vlan60 |
采购部 | 192.168.70.254 | vlan70 |
销售部 | 192.168.80.254 | vlan80 |
所属vlan | 网关 | dns地址 | 地址池网段 |
---|---|---|---|
vlan10 | 192.168.10.254 | 8.8.8.8 | 192.168.10.0/24 |
vlan20 | 192.168.20.254 | 8.8.8.8 | 192.168.20.0/24 |
vlan30 | 192.168.30.254 | 8.8.8.8 | 192.168.30.0/24 |
vlan40 | 192.168.40.254 | 8.8.8.8 | 192.168.40.0/24 |
vlan50 | 192.168.50.254 | 8.8.8.8 | 192.168.50.0/24 |
vlan60 | 192.168.60.254 | 8.8.8.8 | 192.168.60.0/24 |
vlan70 | 192.168.70.254 | 8.8.8.8 | 192.168.70.0/24 |
vlan80 | 192.168.80.254 | 8.8.8.8 | 192.168.80.0/24 |
a、创建vlan10-80
b、售后服务部access模式划入vlan30、库房access模式划入vlan40c、其他链路为trunk中继模式undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW3 //修改名称为SW3[SW3]vlan batch 10 20 30 40 50 60 70 80 //创建vlan10-80[SW3]int g0/0/1 //进入g0/0/1接口[SW3-GigabitEthernet0/0/1]port link-type access //设置模式为接入模式[SW3-GigabitEthernet0/0/1]port default vlan 30 //加入vlan30[SW3-GigabitEthernet0/0/1]quit //退出[SW3]int g0/0/1 //进入g0/0/2接口[SW3-GigabitEthernet0/0/2]port link-type access //设置模式为接入模式[SW3-GigabitEthernet0/0/2]port default vlan 40 //加入vlan40[SW3-GigabitEthernet0/0/2]quit //退出[SW3]port-group group-member g0/0/3 to g0/0/5 //把g0/0/3到g0/0/5加入组中[SW3-port-group]port link-type trunk 把组设置为中继模式[SW3-port-group]port trunk allow-pass vlan all //设置属于所有vlan[SW3-port-group]quit //退出
配置结果
a、创建vlan10-80
b、质管部access模式划入vlan50、生产研发部access模式划入vlan60c、其他链路为trunk中继模式undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW4 //修改名称为SW4[SW4]vlan batch 10 20 30 40 50 60 70 80 //创建vlan10-80[SW4]int g0/0/1 //进入g0/0/1接口[SW4-GigabitEthernet0/0/1]port link-type access //设置模式为接入模式[SW4-GigabitEthernet0/0/1]port default vlan 50 //加入vlan50[SW4-GigabitEthernet0/0/1]quit //退出[SW4]int g0/0/1 //进入g0/0/2接口[SW4-GigabitEthernet0/0/2]port link-type access //设置模式为接入模式[SW4-GigabitEthernet0/0/2]port default vlan 60 //加入vlan60[SW4-GigabitEthernet0/0/2]quit //退出[SW4]port-group group-member g0/0/3 to g0/0/5 //把g0/0/3到g0/0/5加入组中[SW4-port-group]port link-type trunk //把组设置为中继模式[SW4-port-group]port trunk allow-pass vlan all //设置属于所有vlan[SW4-port-group]quit //退出
配置结果
a、创建vlan10-80
b、财务部access模式划入vlan10、综合办access模式划入vlan20c、其他链路为trunk中继模式undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW1 //修改名称为SW1[SW1]vlan batch 10 20 30 40 50 60 70 80 //创建vlan10-80[SW1]int g0/0/4 //进入g0/0/4接口[SW1-GigabitEthernet0/0/4]port link-type access //设置模式为接入模式[SW1-GigabitEthernet0/0/4]port default vlan 10 //加入vlan10[SW1-GigabitEthernet0/0/4]int g0/0/5 //进入g0/0/5接口[SW1-GigabitEthernet0/0/5]port link-type access //设置模式为接入模式[SW1-GigabitEthernet0/0/5]port default vlan 20 //加入vlan10[SW1-GigabitEthernet0/0/5]quit //退出[SW1]port-group group-member g0/0/2 g0/0/1 g0/0/3 g0/0/7 g0/0/6 //将g0/0/1-3和g0/0/6-7加入一个组[SW1-port-group]port link-type trunk //给组设置为中继模式[SW1-port-group]port trunk allow-pass vlan all //让组加入所有vlan[SW1-port-group]quit //退出
a、创建vlan10-80
b、销售部access模式划入vlan80、采购部access模式划入vlan70c、其他链路为trunk中继模式undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW2 //修改名称为SW2[SW2]vlan batch 10 20 30 40 50 60 70 80 //创建vlan10-80[SW2]int g0/0/4 //进入g0/0/4接口[SW2-GigabitEthernet0/0/4]port link-type access //设置模式为接入模式[SW2-GigabitEthernet0/0/4]port default vlan 80 //加入vlan80[SW2-GigabitEthernet0/0/4]int g0/0/5 //进入g0/0/5接口[SW2-GigabitEthernet0/0/5]port link-type access //设置模式为接入模式[SW2-GigabitEthernet0/0/5]port default vlan 70 //加入vlan70[SW2-GigabitEthernet0/0/5]quit //退出[SW2]port-group group-member g0/0/2 g0/0/1 g0/0/3 g0/0/7 g0/0/6 //将g0/0/1-3和g0/0/6-7加入一个组[SW2-port-group]port link-type trunk //给组设置为中继模式[SW2-port-group]port trunk allow-pass vlan all //让组加入所有vlan[SW2-port-group]quit //退出
a、在0/0/2父端口上使用单臂路由设置网关
b、如表,并设置vrrp,设置它为vlan10-40的主路由子接口 | 所属vlan | 网关 | vrrp优先级 | 虚拟网关 |
---|---|---|---|---|
g0/0/2.10 | vlan10 | 192.168.10.254 | 200 | 192.168.10.250 |
g0/0/2.20 | vlan20 | 192.168.20.254 | 200 | 192.168.20.250 |
g0/0/2.30 | vlan30 | 192.168.30.254 | 200 | 192.168.30.250 |
g0/0/2.40 | vlan40 | 192.168.40.254 | 200 | 192.168.40.250 |
c、在0/0/1父端口上使用单臂路由设置网关d、如表,并设置vrrp,设置它为vlan50-80的副路由 | 子接口 | 所属vlan | 网关 | vrrp优先级 | 虚拟网关 |
---|---|---|---|---|---|
g0/0/1.50 | vlan50 | 192.168.50.254 | 150 | 192.168.50.250 | |
g0/0/1.60 | vlan60 | 192.168.60.254 | 150 | 192.168.60.250 | |
g0/0/1.70 | vlan70 | 192.168.70.254 | 150 | 192.168.70.250 | |
g0/0/1.80 | vlan80 | 192.168.80.254 | 150 | 192.168.80.250 |
e、设置g0/0/0的ip地址:为192.168.66.1/24
f、因为有dhcp服务器,与各个部门不在一个网段,所以每个部门的网关都需要设置一下dhcp中继,(dhcp IP地址192.168.99.1)g、设置ospf,区域为0区域,宣告网关192.168.66.0 0.0.0.255、192.168.40.0 0.0.0.255、192.168.10.0 0.0.0.255、192.168.20.0 0.0.0.255、192.168.30.0 0.0.0.255、192.168.50.0 0.0.0.255、192.168.60.0 0.0.0.255、192.168.70.0 0.0.0.255、192.168.80.0 0.0.0.255undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname R1 //更改名称为R1[R1]dhcp enable //开启dhcp功能[R1]int g0/0/2.10 //进入子端口g0/0/2.10[R1-GigabitEthernet0/0/2.10]dot1q termination vid 10 //设置端口模式为802.1q,加入vlan10[R1-GigabitEthernet0/0/2.10]ip add 192.168.10.254 24 //设置vlan10 网关[R1-GigabitEthernet0/0/2.10]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/2.10]vrrp vrid 1 virtual-ip 192.168.10.250 //开启并设置虚拟网关为192.168.10.250 ,虚拟组号为1[R1-GigabitEthernet0/0/2.10]vrrp vrid 1 priority 200 //设置优先级为200[R1-GigabitEthernet0/0/2.10]vrrp vrid 1 track interface GigabitEthernet 0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R1-GigabitEthernet0/0/2.10]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/2.10]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/2.10]quit //退出[R1]int g0/0/2.20 //进入子端口g0/0/2.20[R1-GigabitEthernet0/0/2.20]dot1q termination vid 20 //设置端口模式为802.1q,加入vlan20[R1-GigabitEthernet0/0/2.20]ip add 192.168.20.254 24 //设置vlan20 网关[R1-GigabitEthernet0/0/2.20]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/2.20]vrrp vrid 2 virtual-ip 192.168.20.250 //开启并设置虚拟网关为192.168.20.250 ,虚拟组号为2[R1-GigabitEthernet0/0/2.20]vrrp vrid 2 priority 200 //设置优先级为200[R1-GigabitEthernet0/0/2.20]vrrp vrid 2 track interface g0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R1-GigabitEthernet0/0/2.20]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/2.20]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/2.20]quit //退出[R1]int g0/0/2.30 //进入子端口g0/0/2.30[R1-GigabitEthernet0/0/2.30]dot1q termination vid 30 //设置端口模式为802.1q,加入vlan30[R1-GigabitEthernet0/0/2.30]ip add 192.168.30.254 24 //设置vlan30 网关[R1-GigabitEthernet0/0/2.30]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/2.30]vrrp vrid 3 virtual-ip 192.168.30.250//开启并设置虚拟网关为192.168.30.250 ,虚拟组号为3[R1-GigabitEthernet0/0/2.30]vrrp vrid 3 priority 200 //设置优先级为200[R1-GigabitEthernet0/0/2.30]vrrp vrid 3 track interface g0/0/0 reduced 150//设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R1-GigabitEthernet0/0/2.30]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/2.30]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/2.30]quit //退出[R1]int g0/0/2.40 //进入子端口g0/0/2.40[R1-GigabitEthernet0/0/2.40]dot1q termination vid 40 //设置端口模式为802.1q,加入vlan40[R1-GigabitEthernet0/0/2.40]ip add 192.168.40.254 24 //设置vlan40 网关[R1-GigabitEthernet0/0/2.40]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/2.40]vrrp vrid 4 virtual-ip 192.168.40.250 //开启并设置虚拟网关为192.168.40.250 ,虚拟组号为4[R1-GigabitEthernet0/0/2.40]vrrp vrid 4 priority 200 //设置优先级为200[R1-GigabitEthernet0/0/2.40]vrrp vrid 4 track interface g0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R1-GigabitEthernet0/0/2.40]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/2.40]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/2.40]quit //退出[R1]int g0/0/1.50 //进入子端口g0/0/1.50[R1-GigabitEthernet0/0/1.50]dot1q termination vid 50 //设置端口模式为802.1q,加入vlan50[R1-GigabitEthernet0/0/1.50]ip add 192.168.50.254 24 //设置vlan50 网关[R1-GigabitEthernet0/0/1.50]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/1.50]vrrp vrid 5 virtual-ip 192.168.50.250 //开启并设置虚拟网关为192.168.50.250 ,虚拟组号为5[R1-GigabitEthernet0/0/1.50]vrrp vrid 5 priority 150 //设置优先级为150[R1-GigabitEthernet0/0/1.50]vrrp vrid 5 track interface g0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100 [R1-GigabitEthernet0/0/1.50]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/1.50]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/1.50]quit //退出[R1]int g0/0/1.60 //进入子端口g0/0/1.60[R1-GigabitEthernet0/0/1.60]dot1q termination vid 60 //设置端口模式为802.1q,加入vlan60[R1-GigabitEthernet0/0/1.60]ip add 192.168.60.254 24 //设置vlan60 网关[R1-GigabitEthernet0/0/1.60]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/1.60]vrrp vrid 6 virtual-ip 192.168.60.250 //开启并设置虚拟网关为192.168.60.250 ,虚拟组号为6[R1-GigabitEthernet0/0/1.60]vrrp vrid 6 priority 150 //设置优先级为150[R1-GigabitEthernet0/0/1.60]vrrp vrid 6 track interface g0/0/0 reduced 100//设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R1-GigabitEthernet0/0/1.60]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/1.60]dhcp relay server-ip 192.168.99.1//设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/1.60]quit //退出[R1]int g0/0/1.70 //进入子端口g0/0/1.70[R1-GigabitEthernet0/0/1.70]dot1q termination vid 70 //设置端口模式为802.1q,加入vlan70[R1-GigabitEthernet0/0/1.70]ip add 192.168.70.254 24 //设置vlan70 网关[R1-GigabitEthernet0/0/1.70]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/1.70]vrrp vrid 7 virtual-ip 192.168.70.250//开启并设置虚拟网关为192.168.70.250 ,虚拟组号为7[R1-GigabitEthernet0/0/1.70]vrrp vrid 7 priority 150 //设置优先级为150[R1-GigabitEthernet0/0/1.70]vrrp vrid 7 track interface g0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R1-GigabitEthernet0/0/1.70]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/1.70]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/1.70]quit //退出[R1]int g0/0/1.80 //进入子端口g0/0/1.80[R1-GigabitEthernet0/0/1.80]dot1q termination vid 80 //设置端口模式为802.1q,加入vlan80[R1-GigabitEthernet0/0/1.80]ip add 192.168.80.254 24 //设置vlan80 网关[R1-GigabitEthernet0/0/1.80]arp broadcast enable //开启arp广播[R1-GigabitEthernet0/0/1.80]vrrp vrid 8 virtual-ip 192.168.80.250 //开启并设置虚拟网关为192.168.80.250 ,虚拟组号为8[R1-GigabitEthernet0/0/1.80]vrrp vrid 8 priority 150 //设置优先级为150[R1-GigabitEthernet0/0/1.80]vrrp vrid 8 track interface g0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R1-GigabitEthernet0/0/1.80]dhcp select relay //选择dhcp中继模式[R1-GigabitEthernet0/0/1.80]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R1-GigabitEthernet0/0/1.80]quit//退出[R1]int g0/0/0 //进入端口g0/0/0[R1-GigabitEthernet0/0/0]ip add 192.168.66.1 24 //设置ip[R1-GigabitEthernet0/0/0]quit //退出[R1]ospf 1 //开启并进入ospf,进程号1[R1-ospf-1]area 0 //区域为0[R1-ospf-1-area-0.0.0.0]network 192.168.66.0 0.0.0.255 //宣告192.168.66.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255//宣告192.168.40.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255//宣告192.168.10.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255//宣告192.168.20.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255//宣告192.168.30.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.50.0 0.0.0.255//宣告192.168.50.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.60.0 0.0.0.255//宣告192.168.60.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.70.0 0.0.0.255//宣告192.168.70.0网段[R1-ospf-1-area-0.0.0.0]network 192.168.80.0 0.0.0.255//宣告192.168.80.0网段[R1-ospf-1-area-0.0.0.0]quit //退出[R1-ospf-1]quit //退出
验证[R1]display current-configuration
//常看所有配置
a、在0/0/2父端口上使用单臂路由设置网关
b、如表,并设置vrrp,设置它为vlan10-40的副路由子接口 | 所属vlan | 网关 | vrrp优先级 | 虚拟网关 |
---|---|---|---|---|
g0/0/2.10 | vlan10 | 192.168.10.253 | 150 | 192.168.10.250 |
g0/0/2.20 | vlan20 | 192.168.20.253 | 150 | 192.168.20.250 |
g0/0/2.30 | vlan30 | 192.168.30.253 | 150 | 192.168.30.250 |
g0/0/2.40 | vlan40 | 192.168.40.253 | 150 | 192.168.40.250 |
c、在0/0/1父端口上使用单臂路由设置网关d、如表,并设置vrrp,设置它为vlan50-80的主路由 | 子接口 | 所属vlan | 网关 | vrrp优先级 | 虚拟网关 |
---|---|---|---|---|---|
g0/0/1.50 | vlan50 | 192.168.50.253 | 200 | 192.168.50.250 | |
g0/0/1.60 | vlan60 | 192.168.60.253 | 200 | 192.168.60.250 | |
g0/0/1.70 | vlan70 | 192.168.70.253 | 200 | 192.168.70.250 | |
g0/0/1.80 | vlan80 | 192.168.80.253 | 200 | 192.168.80.250 |
e、设置g0/0/0的ip地址:为192.168.88.1/24
f、因为有dhcp服务器,与各个部门不在一个网段,所以每个部门的网关都需要设置一下dhcp中继,(dhcp IP地址192.168.99.1)g、设置ospf,区域为0区域,宣告网关192.168.88.0 0.0.0.255、192.168.40.0 0.0.0.255、192.168.10.0 0.0.0.255、192.168.20.0 0.0.0.255、192.168.30.0 0.0.0.255、192.168.50.0 0.0.0.255、192.168.60.0 0.0.0.255、192.168.70.0 0.0.0.255、192.168.80.0 0.0.0.255undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname R2 //更改名称为R2[R2]dhcp enable //开启dhcp功能[R2]int g0/0/2.10 //进入子端口g0/0/2.10[R2-GigabitEthernet0/0/2.10]dot1q termination vid 10 //设置端口模式为802.1q,加入vlan10[R2-GigabitEthernet0/0/2.10]ip add 192.168.10.253 24 //设置vlan10 网关[R2-GigabitEthernet0/0/2.10]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/2.10]vrrp vrid 1 virtual-ip 192.168.10.250 //开启并设置虚拟网关为192.168.10.250 ,虚拟组号为1[R2-GigabitEthernet0/0/2.10]vrrp vrid 1 priority 150 //设置优先级为150[R2-GigabitEthernet0/0/2.10]vrrp vrid 1 track interface GigabitEthernet 0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R2-GigabitEthernet0/0/2.10]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/2.10]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/2.10]quit //退出[R2]int g0/0/2.20 //进入子端口g0/0/2.20[R2-GigabitEthernet0/0/2.20]dot1q termination vid 20 //设置端口模式为802.1q,加入vlan20[R2-GigabitEthernet0/0/2.20]ip add 192.168.20.253 24 //设置vlan20 网关[R2-GigabitEthernet0/0/2.20]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/2.20]vrrp vrid 2 virtual-ip 192.168.20.250 //开启并设置虚拟网关为192.168.20.250 ,虚拟组号为2[R2-GigabitEthernet0/0/2.20]vrrp vrid 2 priority 150 //设置优先级为150[R2-GigabitEthernet0/0/2.20]vrrp vrid 2 track interface g0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R2-GigabitEthernet0/0/2.20]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/2.20]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/2.20]quit //退出[R2]int g0/0/2.30 //进入子端口g0/0/2.30[R2-GigabitEthernet0/0/2.30]dot1q termination vid 30 //设置端口模式为802.1q,加入vlan30[R2-GigabitEthernet0/0/2.30]ip add 192.168.30.253 24 //设置vlan30 网关[R2-GigabitEthernet0/0/2.30]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/2.30]vrrp vrid 3 virtual-ip 192.168.30.250//开启并设置虚拟网关为192.168.30.250 ,虚拟组号为3[R2-GigabitEthernet0/0/2.30]vrrp vrid 3 priority 150 //设置优先级为150[R2-GigabitEthernet0/0/2.30]vrrp vrid 3 track interface g0/0/0 reduced 100//设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R2-GigabitEthernet0/0/2.30]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/2.30]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/2.30]quit //退出[R2]int g0/0/2.40 //进入子端口g0/0/2.40[R2-GigabitEthernet0/0/2.40]dot1q termination vid 40 //设置端口模式为802.1q,加入vlan40[R2-GigabitEthernet0/0/2.40]ip add 192.168.40.253 24 //设置vlan40 网关[R2-GigabitEthernet0/0/2.40]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/2.40]vrrp vrid 4 virtual-ip 192.168.40.250 //开启并设置虚拟网关为192.168.40.250 ,虚拟组号为4[R2-GigabitEthernet0/0/2.40]vrrp vrid 4 priority 150 //设置优先级为150[R2-GigabitEthernet0/0/2.40]vrrp vrid 4 track interface g0/0/0 reduced 100 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低100[R2-GigabitEthernet0/0/2.40]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/2.40]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/2.40]quit //退出[R2]int g0/0/1.50 //进入子端口g0/0/1.50[R2-GigabitEthernet0/0/1.50]dot1q termination vid 50 //设置端口模式为802.1q,加入vlan50[R2-GigabitEthernet0/0/1.50]ip add 192.168.50.253 24 //设置vlan50 网关[R2-GigabitEthernet0/0/1.50]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/1.50]vrrp vrid 5 virtual-ip 192.168.50.250 //开启并设置虚拟网关为192.168.50.250 ,虚拟组号为5[R2-GigabitEthernet0/0/1.50]vrrp vrid 5 priority 200 //设置优先级为200[R2-GigabitEthernet0/0/1.50]vrrp vrid 5 track interface g0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150 [R2-GigabitEthernet0/0/1.50]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/1.50]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/1.50]quit //退出[R2]int g0/0/1.60 //进入子端口g0/0/1.60[R2-GigabitEthernet0/0/1.60]dot1q termination vid 60 //设置端口模式为802.1q,加入vlan60[R2-GigabitEthernet0/0/1.60]ip add 192.168.60.253 24 //设置vlan60 网关[R2-GigabitEthernet0/0/1.60]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/1.60]vrrp vrid 6 virtual-ip 192.168.60.250 //开启并设置虚拟网关为192.168.60.250 ,虚拟组号为6[R2-GigabitEthernet0/0/1.60]vrrp vrid 6 priority 200 //设置优先级为200[R2-GigabitEthernet0/0/1.60]vrrp vrid 6 track interface g0/0/0 reduced 150//设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R2-GigabitEthernet0/0/1.60]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/1.60]dhcp relay server-ip 192.168.99.1//设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/1.60]quit //退出[R2]int g0/0/1.70 //进入子端口g0/0/1.70[R2-GigabitEthernet0/0/1.70]dot1q termination vid 70 //设置端口模式为802.1q,加入vlan70[R2-GigabitEthernet0/0/1.70]ip add 192.168.70.253 24 //设置vlan70 网关[R2-GigabitEthernet0/0/1.70]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/1.70]vrrp vrid 7 virtual-ip 192.168.70.250//开启并设置虚拟网关为192.168.70.250 ,虚拟组号为7[R2-GigabitEthernet0/0/1.70]vrrp vrid 7 priority 200 //设置优先级为200[R2-GigabitEthernet0/0/1.70]vrrp vrid 7 track interface g0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R2-GigabitEthernet0/0/1.70]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/1.70]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/1.70]quit //退出[R2]int g0/0/1.80 //进入子端口g0/0/1.80[R2-GigabitEthernet0/0/1.80]dot1q termination vid 80 //设置端口模式为802.1q,加入vlan80[R2-GigabitEthernet0/0/1.80]ip add 192.168.80.253 24 //设置vlan80 网关[R2-GigabitEthernet0/0/1.80]arp broadcast enable //开启arp广播[R2-GigabitEthernet0/0/1.80]vrrp vrid 8 virtual-ip 192.168.80.250 //开启并设置虚拟网关为192.168.80.250 ,虚拟组号为8[R2-GigabitEthernet0/0/1.80]vrrp vrid 8 priority 200//设置优先级为200[R2-GigabitEthernet0/0/1.80]vrrp vrid 8 track interface g0/0/0 reduced 150 //设置端口跟踪,跟踪g0/0/0如果端口断开优先级降低150[R2-GigabitEthernet0/0/1.80]dhcp select relay //选择dhcp中继模式[R2-GigabitEthernet0/0/1.80]dhcp relay server-ip 192.168.99.1 //设置中继dhcp服务器为192.168.99.1[R2-GigabitEthernet0/0/1.80]quit//退出[R2]int g0/0/0 //进入端口g0/0/0[R2-GigabitEthernet0/0/0]ip add 192.168.88.1 24 //设置ip[R2-GigabitEthernet0/0/0]quit //退出[R2]ospf 1 //开启并进入ospf,进程号1[R2-ospf-1]area 0 //区域为0[R2-ospf-1-area-0.0.0.0]network 192.168.88.0 0.0.0.255 //宣告192.168.88.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.40.0 0.0.0.255//宣告192.168.40.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255//宣告192.168.10.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255//宣告192.168.20.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.30.0 0.0.0.255//宣告192.168.30.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.50.0 0.0.0.255//宣告192.168.50.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.60.0 0.0.0.255//宣告192.168.60.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.70.0 0.0.0.255//宣告192.168.70.0网段[R2-ospf-1-area-0.0.0.0]network 192.168.80.0 0.0.0.255//宣告192.168.80.0网段[R2-ospf-1-area-0.0.0.0]quit //退出[R2-ospf-1]quit //退出
验证[R2]display current-configuration
//常看所有配置
a、它的作用是起单层路由器的作用
b、设置5个vlan 分别为valn66、vlan88、vlan99、vlan77为联通使用、vlan55为电信使用。所属vlan | ip设置 |
---|---|
valn66 | 192.168.66.2/24 |
vlan88 | 192.168.88.2/24 |
vlan99 | 192.168.99.2/24 |
vlan77 | 192.168.77.1/24 |
vlan55 | 192.168.55.1/24 |
c、设置ospf,区域为0区域,宣告网关192.168.66.0 0.0.0.255 、192.168.88.0 0.0.0.255、192.168.99.0 0.0.0.255、192.168.77.0 0.0.0.255、192.168.55.0 0.0.0.255
undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW5 //更改名称为SW5[SW5]vlan batch 66 88 99 77 55 //创建vlan55、66、77、88、99[SW5]int vlanif 66 //进入vlan66[SW5-Vlanif66]ip add 192.168.66.2 24 //设置vlan66的网关ip[SW5-Vlanif66]int vlanif 88 //进入vlan88[SW5-Vlanif88]ip add 192.168.88.2 24 //设置vlan88的网关ip[SW5-Vlanif88]int vlanif 99 //进入vlan99[SW5-Vlanif99]ip add 192.168.99.2 24 //设置vlan99的网关ip[SW5-Vlanif99]int vlanif 77 //进入vlan77[SW5-Vlanif77]ip add 192.168.77.1 24 //设置vlan77的网关ip[SW5-Vlanif77]int vlanif 55 //进入vlan55[SW5-Vlanif55]ip add 192.168.55.1 24 //设置vlan55的网关ip[SW5-Vlanif55]quit //退出[SW5]int g0/0/3 //进入端口g0/0/3[SW5-GigabitEthernet0/0/3]port link-type access //设置接入模式[SW5-GigabitEthernet0/0/3]port default vlan 66//划入vlan66[SW5-GigabitEthernet0/0/3]quit//退出[SW5]int g0/0/4 //进入端口g0/0/4[SW5-GigabitEthernet0/0/4]port link-type access //设置接入模式[SW5-GigabitEthernet0/0/4]port default vlan 88//划入vlan88[SW5-GigabitEthernet0/0/4]quit//退出[SW5]int g0/0/5 //进入端口g0/0/5[SW5-GigabitEthernet0/0/5]port link-type access //设置接入模式[SW5-GigabitEthernet0/0/5]port default vlan 99//划入vlan99[SW5-GigabitEthernet0/0/5]quit //退出[SW5]int g0/0/1 //进入端口g0/0/1[SW5-GigabitEthernet0/0/1]port link-type access //设置接入模式[SW5-GigabitEthernet0/0/1]port default vlan 77 //划入vlan77[SW5-GigabitEthernet0/0/1]int g0/0/2 //进入端口g0/0/2[SW5-GigabitEthernet0/0/2]port link-type access //设置接入模式[SW5-GigabitEthernet0/0/2]port default vlan 55 //划入vlan55[SW5-GigabitEthernet0/0/2]quit //退出[SW5]ospf 1 //开启并进入ospf,进程号1[SW5-ospf-1]area 0 ]area 0 //区域为0[SW5-ospf-1-area-0.0.0.0]network 192.168.66.0 0.0.0.255 //宣告192.168.66.0网段[SW5-ospf-1-area-0.0.0.0]network 192.168.77.0 0.0.0.255 //宣告192.168.77.0网段[SW5-ospf-1-area-0.0.0.0]network 192.168.55.0 0.0.0.255//宣告192.168.55.0网段[SW5-ospf-1-area-0.0.0.0]network 192.168.88.0 0.0.0.255//宣告192.168.88.0网段[SW5-ospf-1-area-0.0.0.0]network 192.168.99.0 0.0.0.255//宣告192.168.99.0网段[SW5-ospf-1-area-0.0.0.0]quit //退出[SW5-ospf-1]quit //退出
验证:[SW5]display current-configuration //常看所有配置
a、这个三层交换机是公司的dhcp服务器
b、创建vlan99,并设置vlan99的ip地址c、并开启dhcp功能,创建vlan10-80的地址池d、把g0/0/1划入vlan99,在端口上开启dhcp全局模式e、设置ospf,区域为0区域,宣告网关192.168.99.0 0.0.0.255undo terminal monitor //关闭终端监控 system-view //进入系统模式[Huawei]sysname SW6 //更改名称为SW6[SW6]vlan 99 //创建vlan99[SW6-vlan99]quit //退出[SW6]int vlanif 99 //进入vlan99[SW6-Vlanif99]ip add 192.168.99.1 24 //设置vlan99的ip[SW6-Vlanif99]quit //退出[SW6]int g0/0/1 //进入g0/0/1端口[SW6-GigabitEthernet0/0/1]port link-type access //设置接入模式[SW6-GigabitEthernet0/0/1]port default vlan 99 //划入vlan99[SW6-GigabitEthernet0/0/1]quit //退出[SW6]dhcp enable //开启dhcp功能[SW6]ip pool vlan10 //创建地址池vlan10 [SW6-ip-pool-vlan10]network 192.168.10.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan10]gateway-list 192.168.10.250 //设置vlan10网关[SW6-ip-pool-vlan10]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan10]quit //退出[SW6]ip pool vlan20 //创建地址池vlan20 [SW6-ip-pool-vlan20]network 192.168.20.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan20]gateway-list 192.168.20.250 //设置vlan20网关[SW6-ip-pool-vlan20]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan20]quit //退出[SW6]ip pool vlan30 //创建地址池vlan30 [SW6-ip-pool-vlan30]network 192.168.30.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan30]gateway-list 192.168.30.250 //设置vlan30网关[SW6-ip-pool-vlan30]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan30]quit //退出[SW6]ip pool vlan40 //创建地址池vlan40 [SW6-ip-pool-vlan40]network 192.168.40.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan40]gateway-list 192.168.40.250 //设置vlan40网关[SW6-ip-pool-vlan40]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan40]quit //退出[SW6]ip pool vlan50 //创建地址池vlan50 [SW6-ip-pool-vlan50]network 192.168.50.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan50]gateway-list 192.168.50.250 //设置vlan50网关[SW6-ip-pool-vlan50]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan50]quit //退出[SW6]ip pool vlan60 //创建地址池vlan60 [SW6-ip-pool-vlan60]network 192.168.60.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan60]gateway-list 192.168.60.250 //设置vlan60网关[SW6-ip-pool-vlan60]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan60]quit //退出[SW6]ip pool vlan70 //创建地址池vlan70 [SW6-ip-pool-vlan70]network 192.168.70.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan70]gateway-list 192.168.70.250 //设置vlan70网关[SW6-ip-pool-vlan70]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan70]quit //退出[SW6]ip pool vlan80 //创建地址池vlan80 [SW6-ip-pool-vlan80]network 192.168.80.0 mask 255.255.255.0 //设置网段[SW6-ip-pool-vlan80]gateway-list 192.168.80.250 //设置vlan70网关[SW6-ip-pool-vlan80]dns-list 8.8.8.8 //设置dns地址[SW6-ip-pool-vlan80]quit //退出[SW6]int vlanif 99 //进入vlan99[SW6-Vlanif99]dhcp select global //开启dhcp全局模式[SW6-Vlanif99]quit //退出[SW6]ospf 1 //开启并进入ospf,进程号1[SW6-ospf-1]area 0 //区域为0[SW6-ospf-1-area-0.0.0.0]network 192.168.99.0 0.0.0.255 //宣告192.168.99.0网段[SW6-ospf-1-area-0.0.0.0]quit //退出[SW6-ospf-1]quit //退出
验证:[SW6]display current-configuration //查询所有配置
最近一段时间感冒了(非常严重o_O),没时间写博客了,断了一个星期,也不知道写那些东西了。也没什么思路,想写一些对自己有用的东西,可是迟迟不知道写什么。有个朋友想创建公司,于是我就给朋友作了个拓扑,我这技术估计纯属给朋友段乱的吧。。呵呵。。
转载于:https://blog.51cto.com/13445059/2066207