单臂路由应用实例

本文详细介绍了一种典型的网络配置方案——单臂路由的实际应用。通过配置交换机的Trunk链路及VLAN划分,实现不同局域网间的隔离与互通。同时,路由器作为DHCP服务器分配IP地址,并设置内网和外网路由,确保各VLAN内的PC能够自动获取IP并访问内外网资源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、拓扑图

1、拓扑图

在这里插入图片描述

2、要求

  ①、PC自动获取IP可以访问内网网页和外网的网页
  ②、利用VLAN隔绝广播域,且不同VLAN可以互相通信

二、配置交换机

1、创建Trunk链路

  ①、不同交换机具体如下

	SW1:configure terminal
			interface f0/3
			switchport mode trunk
			exit
	SW2:configure terminal
			interface range f0/3-5
			switchport mode trunk
			exit
	SW3:configure terminal
			interface  f0/3
			switchport mode trunk
			exit
		关闭: interface f0/x
			no switchport mode trunk
			exit

2、vtp domain命令

  ①、vtp domain 用于创建、删除、修改VLAN

		vtp domain  monkey
		vlan 10
		exit
		vlan 20
		exit
		vlan 30
		exit
		vlan 40
		exit

3、接口划分VLAN

  ①、不同交换机具体操作如下

   SW1:configure  terminal
		interface f0/1
		switchport access vlan 10
		exit
		interface f0/2
		switchport access vlan 20
   SW2:configure  terminal
		interface f0/1
		switchport access vlan 10
		exit
		interface f0/2
		switchport access vlan30
   SW3:configure  terminal
		interface f0/1
		switchport access vlan 20
		exit
		interface f0/2
		switchport access vlan 40

三、配置路由器

1、路由器当DHCP服务器

  ①、设置子接口

		configure terminal
		interface f0/0.1
		encapsulation dot1q 10    //对应VLAN10
		ip address 123.0.0.254  255.255.255.0  //设置子接口IP
		no shutdown 
		exit
		interface f0/0.2
		encapsulation dot1q 20    //对应VLAN20
		ip address 124.0.0.254  255.255.255.0  //设置子接口IP
		no shutdown 
		exit
		interface f0/0.3
		encapsulation dot1q 30    //对应VLAN30
		ip address 125.0.0.254  255.255.255.0  //设置子接口IP
		no shutdown 
		exit
		interface f0/0.4
		encapsulation dot1q 40    //对应VLAN40
		ip address 126.0.0.254  255.255.255.0  //设置子接口IP
		no shutdown 
		exit

  ②、部署DHCP

		configure  terminal
		ip dhcp excluded-address 123.0.0.1  123.0.0.99   //排除IP的范围
		ip dhcp pool v10  //设置不同的地址池
		network 123.0.0.0 255.255.255.0
		default-router 123.0.0.254
		dns-server 126.0.0.1
		exit
		ip dhcp excluded-address 124.0.0.1  124.0.0.99   //排除IP的范围
		ip dhcp pool v20  //设置不同的地址池
		network 124.0.0.0 255.255.255.0
		default-router 124.0.0.254
		dns-server 126.0.0.1
		exit
		ip dhcp excluded-address 125.0.0.1  125.0.0.99   //排除IP的范围
		ip dhcp pool v30  //设置不同的地址池
		network 125.0.0.0 255.255.255.0
		default-router 125.0.0.254
		dns-server 126.0.0.1
		exit

  ③、设置DNS服务器,并打开

在这里插入图片描述

2、DHCP服务器中继

  ①、服务器上添加DHCP服务器
在这里插入图片描述

  ②、路由器设置

			configure terminal
			interface f0/0.1
			ip helper-address 126.0.0.1
			exit
			interface f0/0.2
			ip helper-address 126.0.0.1
			exit
			interface f0/0.3
			ip helper-address 126.0.0.1
			exit

3、内网路由与外网路由设置

  ①、注意不要随意使用路由默认,容易导致路由环路

内网路由:configure terminal
	 	 ip route 0.0.0.0  0.0.0.0  202.0.0.2
外网路由:configure terminal
		 ip route  123.0.0.0 255.255.255.0  202.0.0.1
		 ip route  124.0.0.0 255.255.255.0  202.0.0.1
		 ip route  125.0.0.0 255.255.255.0  202.0.0.1
		 ip route  126.0.0.0 255.255.255.0  202.0.0.1
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风云小虾米

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值