学习通拓扑图配置命令示例:交换机、路由器、服务器
学习通拓扑图配置命令示例:交换机、路由器、服务器
配置拓扑图需要使用命令行界面,通过输入命令来配置设备的参数。
拓扑图示例:
+------------+
| Switch1 |
+-----+------+
|
|
+-----+------+
| Switch2 |
+-----+------+
|
|
+---------------+---------------+
| | |
| +----+----+ +----+----+
| | Router1 | | Server1 |
| +---------+ +---------+
| |
| |
| +----+----+
| | Router2 |
| +---------+
| |
| |
| +----+----+
| | Server2 |
| +---------+
|
配置命令:
1. 配置交换机的 VLAN:
Switch1(config)# vlan 10
Switch1(config-vlan)# name 'Sales'
Switch1(config-vlan)# exit
Switch2(config)# vlan 20
Switch2(config-vlan)# name 'Marketing'
Switch2(config-vlan)# exit
2. 配置交换机的端口:
Switch1(config)# interface FastEthernet0/1
Switch1(config-if)# switchport mode access
Switch1(config-if)# switchport access vlan 10
Switch1(config-if)# exit
Switch2(config)# interface FastEthernet0/1
Switch2(config-if)# switchport mode access
Switch2(config-if)# switchport access vlan 20
Switch2(config-if)# exit
3. 配置路由器的接口:
Router1(config)# interface GigabitEthernet0/0
Router1(config-if)# ip address 192.168.1.1 255.255.255.0
Router1(config-if)# no shutdown
Router1(config-if)# exit
Router2(config)# interface GigabitEthernet0/0
Router2(config-if)# ip address 192.168.2.1 255.255.255.0
Router2(config-if)# no shutdown
Router2(config-if)# exit
4. 配置路由器的静态路由:
Router1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.2
Router2(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.2
5. 配置服务器的 IP 地址:
Server1> enable
Server1# configure terminal
Server1(config)# interface eth0
Server1(config-if)# ip address 192.168.1.10 255.255.255.0
Server1(config-if)# no shutdown
Server1(config-if)# exit
Server2> enable
Server2# configure terminal
Server2(config)# interface eth0
Server2(config-if)# ip address 192.168.2.10 255.255.255.0
Server2(config-if)# no shutdown
Server2(config-if)# exit
以上是一些常用的配置命令,可以根据具体的需求进行调整。在实际的网络环境中,还有很多其他的配置命令和参数,需要根据具体的情况进行使用。
原文地址: https://www.cveoy.top/t/topic/oBWY 著作权归作者所有。请勿转载和采集!