4.12

![](vx_images/109164820236746.png)
将通信接通
使用dhcp
使用ospf路由
链路聚合

![](vx_images/209964920256912.png)

二层交换机:
Sw0:

vlan 10
vlan 20
int f0/1
switchport access vlan 10
int f0/2
switchport mode trunk 
int f0/4
switchport mode trunk 

Sw2:

vlan 10
vlan20
int f0/1
int f0/3
int f0/2
switchport mode trunk 
int f0/4
switchport mode trunk 

![](vx_images/389745520249581.png)
将相应端口设置为trunk模式
Sw2:

int f0/2
switchport trunk encapsulation dot1q
switchport mode trunk 
int f0/4
switchport trunk encapsulation dot1q
switchport mode trunk 
int range f0/11-12
switchport trunk encapsulation dot1q
switchport mode trunk 

Sw3:

int f0/2
switchport trunk encapsulation dot1q
switchport mode trunk 
int f0/4
switchport trunk encapsulation dot1q
switchport mode trunk 
int range f0/11-12
switchport trunk encapsulation dot1q
switchport mode trunk 

创建设置链路聚合
Sw2:

int range f0/11-12
channel-group 1 mode on
sw t e dot1q 
switchport mode trunk 
spanning-tree vlan 10 priority 0

Sw3:

int range f0/11-12
channel-group 1 mode on
sw t e dot1q 
switchport mode trunk 
spanning-tree vlan 20 priority 0

虚拟网关
Sw2:
vlan10:

ip address 192.168.10.252 255.255.255.0
standby 10 ip 192.168.10.254

vlan20:

ip address 192.168.20.252 255.255.255.0
standby 10 ip 192.168.20.254

Sw3:
vlan10:

ip address 192.168.10.253 255.255.255.0
standby 10 ip 192.168.10.254

vlan20:

ip address 192.168.20.253 255.255.255.0
standby 10 ip 192.168.20.254

![](vx_images/249435821256912.png)
2911
dhcp:

ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 192.168.117.117

dhcp2:

ip dhcp pool vlan10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 192.168.117.117

Sw2:

int vlan 10
ip helper-address 172.16.1.2
int vlan 20
ip helper-address 172.16.1.2

Sw3

int vlan 10
ip helper-address 172.16.2.2
int vlan 20
ip helper-address 172.16.2.2

![](vx_images/299731322248879.png)
2911
int g0/2
ip add 100.1.1.1 255.255.255.0

int range g0/0-1
ip nat inside

静态路由:

ip route 0.0.0.0 0.0.0.0 100.1.1.2 //静态路由
default-information originate   //广播到OSPF区域。标记O*E2.

NAT设置

access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
int range g0/0-1

ip nat inside source list 1 interface g0/2 overload

R1(2911)

int g0/0
ip add 100.1.1.2 255.255.255.0
最后修改:2023 年 04 月 12 日
如果觉得我的文章对你有用,请随意赞赏