编写一个涵盖ospf协议、rip协议、 stp技术, acl技术,vlan的划分,ipv6的配置,eigrp协议, dhcp技术,nat技术, aaa技术,请把此拓扑图将两个左侧pc机连接一个左侧二层交换机,另外两个左侧pc机连接一个左侧二层交换机 ,两个左侧二层交换机与一个左侧三层交换机连接, 左侧三层交换机与左侧路由器连接,左侧路由器与中间路由器连接,中间的路由器与右侧路由器连接,右侧路由器连接一个右侧三层交换机,右侧三层交换机连接两个右侧二层交换机,两个右侧二层交换机各连接两个右侧pc机,配置每个接口的地址,写出该地址的地址表,必须实现不同协议的交叉互通,及所有设备进行SSH登录,还要体现二、三层的安全保护,请写出每条技术的配置命令
时间: 2023-07-15 21:15:46 浏览: 90
网络常用配置命令,包括dhcp,ospf,rip,以及常用的命令
拓扑图如下:
```
+-------------------+ +-------------------+
| Left SW1 | | Right SW1 |
| | | |
| Fa0/1 Fa0/2 +--------------------+ Fa0/1 Fa0/2 |
+-------------------+ +-------------------+
| |
| |
+-------------------+ +-------------------+
| Left SW2 | | Right SW2 |
| | | |
| Fa0/1 Fa0/2 +--------------------+ Fa0/1 Fa0/2 |
+-------------------+ +-------------------+
| |
| |
+-------------------+ +-------------------+
| Left L3 SW | | Right L3 SW |
| | | |
| Fa0/1 Fa0/2 +--------------------+ Fa0/1 Fa0/2 |
| | +-----------+ | |
| +-----+ Left Router+---+ |
| Gi0/1 +-----------+ | Gi0/1 |
+-------------------+ +-------------------+
| |
| |
| |
| |
| |
+-----------+ +-----------+
|Middle RTR | |Right Router|
| | | |
|Gi0/0 Gi0/1+-----------------+Gi0/0 |
+-----------+ +-----------+
```
以下是每个技术的配置命令:
1. OSPF协议
左侧L3交换机:
```
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.2.0 0.0.0.255 area 0
```
右侧L3交换机:
```
router ospf 1
network 172.16.1.0 0.0.0.255 area 0
network 172.16.2.0 0.0.0.255 area 0
```
2. RIP协议
左侧L3交换机:
```
router rip
network 192.168.1.0
network 192.168.2.0
```
右侧L3交换机:
```
router rip
network 172.16.1.0
network 172.16.2.0
```
3. STP技术
所有二层交换机默认开启STP,无需额外配置。
4. ACL技术
左侧L3交换机:
```
access-list 101 permit tcp any host 192.168.1.2 eq 22
access-list 101 permit tcp any host 192.168.2.2 eq 22
interface fa0/1
ip access-group 101 in
```
右侧L3交换机:
```
access-list 102 permit tcp any host 172.16.1.2 eq 22
access-list 102 permit tcp any host 172.16.2.2 eq 22
interface fa0/1
ip access-group 102 in
```
5. VLAN的划分
左侧SW1:
```
vlan 10
name Left_PC_VLAN
vlan 20
name Left_L3SW_VLAN
interface fa0/1
switchport mode access
switchport access vlan 10
interface fa0/2
switchport mode access
switchport access vlan 20
```
左侧SW2:
```
vlan 30
name Right_PC_VLAN
vlan 40
name Right_L3SW_VLAN
interface fa0/1
switchport mode access
switchport access vlan 30
interface fa0/2
switchport mode access
switchport access vlan 40
```
左侧L3交换机:
```
vlan 10
name Left_PC_VLAN
vlan 20
name Left_L3SW_VLAN
vlan 30
name Right_PC_VLAN
vlan 40
name Right_L3SW_VLAN
interface fa0/1
switchport mode access
switchport access vlan 20
interface fa0/2
switchport mode access
switchport access vlan 40
interface gi0/1
switchport mode access
switchport access vlan 20
interface gi0/2
switchport mode access
switchport access vlan 40
```
右侧SW1:
```
vlan 50
name Right_SW1_VLAN
vlan 60
name Right_SW2_VLAN
interface fa0/1
switchport mode access
switchport access vlan 50
interface fa0/2
switchport mode access
switchport access vlan 60
```
右侧SW2:
```
vlan 70
name Right_PC_VLAN
vlan 80
name Right_L3SW_VLAN
interface fa0/1
switchport mode access
switchport access vlan 70
interface fa0/2
switchport mode access
switchport access vlan 80
```
右侧L3交换机:
```
vlan 50
name Right_SW1_VLAN
vlan 60
name Right_SW2_VLAN
vlan 70
name Right_PC_VLAN
vlan 80
name Right_L3SW_VLAN
interface fa0/1
switchport mode access
switchport access vlan 50
interface fa0/2
switchport mode access
switchport access vlan 60
interface gi0/1
switchport mode access
switchport access vlan 70
interface gi0/2
switchport mode access
switchport access vlan 80
```
6. IPv6的配置
左侧L3交换机:
```
ipv6 unicast-routing
interface fa0/1
ipv6 address 2001:db8:1::1/64
interface fa0/2
ipv6 address 2001:db8:2::1/64
```
右侧L3交换机:
```
ipv6 unicast-routing
interface fa0/1
ipv6 address 2001:db8:3::1/64
interface fa0/2
ipv6 address 2001:db8:4::1/64
```
7. EIGRP协议
左侧L3交换机:
```
router eigrp 1
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
```
右侧L3交换机:
```
router eigrp 1
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
```
8. DHCP技术
左侧L3交换机:
```
ip dhcp pool Left_PC_Pool
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8
ip dhcp pool Right_PC_Pool
network 172.16.1.0 255.255.255.0
default-router 172.16.1.1
dns-server 8.8.8.8
```
9. NAT技术
左侧路由器:
```
interface gi0/0
ip nat outside
interface gi0/1
ip nat inside
ip access-list standard NAT_ACL
permit 192.168.1.0 0.0.0.255
permit 192.168.2.0 0.0.0.255
ip nat inside source list NAT_ACL interface gi0/0 overload
```
右侧路由器:
```
interface gi0/0
ip nat outside
interface gi0/1
ip nat inside
ip access-list standard NAT_ACL
permit 172.16.1.0 0.0.0.255
permit 172.16.2.0 0.0.0.255
ip nat inside source list NAT_ACL interface gi0/0 overload
```
10. AAA技术
所有设备都需要进行以下配置:
```
aaa new-model
aaa authentication login default local
username admin secret 0 password
line vty 0 15
login authentication default
transport input ssh
```
阅读全文