码迷,mamicode.com
首页 > 其他好文 > 详细

网络拓扑图练习

时间:2018-10-07 10:32:41      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:服务器   ima   1.2   null   color   user   outer   ping   access   

拓扑图

技术分享图片

实现:

1.给每种服务器创建不同VLAN划分

2.pc1和pc2可以互相访问

3.pc3-pc11之间可以互相访问

AR1

[Huawei]sysname router1
[router1]interface GigabitEthernet 0/0/0
[router1-GigabitEthernet0/0/0]ip address 192.168.1.254 24
Oct  7 2018 03:40:00-08:00 router1 %%01IFNET/4/LINK_STATE(l)[0]:The line protoco
l IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[router1-GigabitEthernet0/0/0]q
[router1]interface GigabitEthernet 0/0/1
[router1-GigabitEthernet0/0/1]ip address 192.168.12.1 24
Oct  7 2018 03:41:00-08:00 router1 %%01IFNET/4/LINK_STATE(l)[1]:The line protoco
l IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[router1-GigabitEthernet0/0/1]q
[router1]ospf    
[router1]ospf 1
[router1-ospf-1]area    
[router1-ospf-1]area 0
[router1-ospf-1-area-0.0.0.0]netwo    
[router1-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
[router1-ospf-1-area-0.0.0.0]q
[router1-ospf-1]area 1
[router1-ospf-1-area-0.0.0.1]netwo    
[router1-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[router1-ospf-1-area-0.0.0.1]q
[router1-ospf-1]q
[router1]q    
<router1>save 

 

AR2

[Huawei]sysname router2
[router2]interface g    
[router2]interface GigabitEthernet 0/0/0
[router2-GigabitEthernet0/0/0]ip add    
[router2-GigabitEthernet0/0/0]ip address 192.168.12.2 24
Oct  7 2018 03:43:12-08:00 router2 %%01IFNET/4/LINK_STATE(l)[0]:The line protoco
l IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[router2-GigabitEthernet0/0/0]q    
[router2]interface g    
[router2]interface GigabitEthernet 0/0/1
[router2-GigabitEthernet0/0/1]ip add    
[router2-GigabitEthernet0/0/1]ip address 192.168.2.254 24
[router2-GigabitEthernet0/0/1]
Oct  7 2018 03:43:36-08:00 router2 %%01IFNET/4/LINK_STATE(l)[1]:The line protoco
l IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[router2-GigabitEthernet0/0/1]q
[router2]ospf 1
[router2-ospf-1]area 1    
[router2-ospf-1-area-0.0.0.1]network 192.168.12.0 0.0.0.255
[router2-ospf-1-area-0.0.0.1]q
[router2-ospf-1]netwo    
[router2-ospf-1]area 0    
[router2-ospf-1-area-0.0.0.0]q
[router2-ospf-1]area    
[router2-ospf-1]area 1
[router2-ospf-1-area-0.0.0.1]undo network 192.168.12.0 0.0.0.255    
[router2-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255
[router2-ospf-1-area-0.0.0.1]q
[router2-ospf-1]area 0
[router2-ospf-1-area-0.0.0.0]netwo    
[router2-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
[router2-ospf-1-area-0.0.0.0]
[router2-ospf-1-area-0.0.0.0]q
[router2-ospf-1]q
[router2]q
<router2>save

 

HXJHJ

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname hxjhj    
[hxjhj]vlan batch 1 to 4    
[hxjhj]interface Vlanif 1    
[hxjhj-Vlanif1]ip address 192.168.154.1 24
[hxjhj-Vlanif1]q    
[hxjhj]interface Vlanif 2
[hxjhj-Vlanif2]ip address 192.168.3.254 24
[hxjhj-Vlanif2]q    
[hxjhj]interface Vlanif 3
[hxjhj-Vlanif3]ip address 192.168.4.254 24
[hxjhj-Vlanif3]q    
[hxjhj]interface Vlanif 4
[hxjhj-Vlanif4]ip address 192.168.5.254 24
[hxjhj-Vlanif4]q        
[hxjhj]interface GigabitEthernet 0/0/3    
[hxjhj-GigabitEthernet0/0/3]port link-type access 
[hxjhj-GigabitEthernet0/0/3]port default vlan 2
[hxjhj-GigabitEthernet0/0/3]q    
[hxjhj]interface GigabitEthernet 0/0/4    
[hxjhj-GigabitEthernet0/0/4]port link-type access 
[hxjhj-GigabitEthernet0/0/4]port default vlan 3    
[hxjhj-GigabitEthernet0/0/4]q    
[hxjhj]interface GigabitEthernet 0/0/5    
[hxjhj-GigabitEthernet0/0/5]port link-type access 
[hxjhj-GigabitEthernet0/0/5]port default vlan 4
[hxjhj-GigabitEthernet0/0/5]q    
[hxjhj]interface g    
[hxjhj]interface GigabitEthernet 0/0/1    
[hxjhj-GigabitEthernet0/0/1]port link-type access 
[hxjhj-GigabitEthernet0/0/1]port default vlan 1
[hxjhj-GigabitEthernet0/0/1]q    
[hxjhj]interface GigabitEthernet 0/0/2
[hxjhj-GigabitEthernet0/0/2]port link-type access 
[hxjhj-GigabitEthernet0/0/2]port default vlan 1
[hxjhj-GigabitEthernet0/0/2]q    
[hxjhj]interface GigabitEthernet 0/0/6    
[hxjhj-GigabitEthernet0/0/6]port link-type access 
[hxjhj-GigabitEthernet0/0/6]port default vlan 1

[hxjhj]ospf 1    
[hxjhj-ospf-1]area 0    
[hxjhj-ospf-1-area-0.0.0.0]network     
[hxjhj-ospf-1-area-0.0.0.0]network 192.168.254.0 0.0.0.255
[hxjhj-ospf-1-area-0.0.0.0]q
[hxjhj-ospf-1]area 1    
[hxjhj-ospf-1-area-0.0.0.1]network 
[hxjhj-ospf-1-area-0.0.0.1]network 192.168.3.0 0.0.0.255
[hxjhj-ospf-1-area-0.0.0.1]q
[hxjhj-ospf-1]area 2    
[hxjhj-ospf-1-area-0.0.0.2]network 
[hxjhj-ospf-1-area-0.0.0.2]network 192.168.4.0 0.0.0.255
[hxjhj-ospf-1-area-0.0.0.2]q
[hxjhj-ospf-1]area 3    
[hxjhj-ospf-1-area-0.0.0.3]network 192.168.5.0 0.0.0.255
[hxjhj-ospf-1-area-0.0.0.3]q
[hxjhj-ospf-1]

结果:

<hxjhj>dis cur
#
sysname hxjhj
#
vlan batch 2 to 4
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
 ip address 192.168.254.1 255.255.255.0
#
interface Vlanif2
 ip address 192.168.3.254 255.255.255.0
#
interface Vlanif3
 ip address 192.168.4.254 255.255.255.0
#
interface Vlanif4
 ip address 192.168.5.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type access
#
interface GigabitEthernet0/0/2
 port link-type access
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 2
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 3
#
interface GigabitEthernet0/0/5
 port link-type access
 port default vlan 4
#
interface GigabitEthernet0/0/6
 port link-type access
#
...
#
ospf 1
 area 0.0.0.0
  network 192.168.254.0 0.0.0.255
 area 0.0.0.1
  network 192.168.3.0 0.0.0.255
 area 0.0.0.2
  network 192.168.4.0 0.0.0.255
 area 0.0.0.3
  network 192.168.5.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return

 

HJJHJ1

<Huawei>system-view 
[Huawei]sysname jrjhj1    
[jrjhj1]vlan batch 1 to 7    
[jrjhj1]interface Vlanif 1
[jrjhj1-Vlanif1]ip address 192.168.254.2 24
[jrjhj1-Vlanif1]q    
[jrjhj1]interface Vlanif 5
[jrjhj1-Vlanif5]ip address 192.168.6.254 24
[jrjhj1-Vlanif5]q
[jrjhj1]interface Vlanif 6
[jrjhj1-Vlanif6]ip address 192.168.7.254 24
[jrjhj1-Vlanif6]q
[jrjhj1]interface Vlanif 7
[jrjhj1-Vlanif7]ip address 192.168.8.254 24
[jrjhj1-Vlanif7]q    
[jrjhj1]interface GigabitEthernet 0/0/1    
[jrjhj1-GigabitEthernet0/0/1]port link-type access 
[jrjhj1-GigabitEthernet0/0/1]port default vlan 1
[jrjhj1-GigabitEthernet0/0/1]q
[jrjhj1]interface GigabitEthernet 0/0/2    
[jrjhj1-GigabitEthernet0/0/2]port link-type access 
[jrjhj1-GigabitEthernet0/0/2]port default vlan 5
[jrjhj1-GigabitEthernet0/0/2]q
[jrjhj1]interface GigabitEthernet 0/0/3
[jrjhj1-GigabitEthernet0/0/3]port link-type access 
[jrjhj1-GigabitEthernet0/0/3]port default vlan 6
[jrjhj1-GigabitEthernet0/0/3]q    
[jrjhj1]interface GigabitEthernet 0/0/4    
[jrjhj1-GigabitEthernet0/0/4]port link-type access 
[jrjhj1-GigabitEthernet0/0/4]port default vlan 7
[jrjhj1-GigabitEthernet0/0/4]q
[jrjhj1]ospf 1
[jrjhj1-ospf-1]area 0
[jrjhj1-ospf-1-area-0.0.0.0]network 192.168.254.0 0.0.0.255
[jrjhj1-ospf-1-area-0.0.0.0]q
[jrjhj1-ospf-1]    
[jrjhj1-ospf-1]area 1
[jrjhj1-ospf-1-area-0.0.0.1]    
[jrjhj1-ospf-1-area-0.0.0.1]network 192.168.6.0 0.0.0.255
[jrjhj1-ospf-1-area-0.0.0.1]q
[jrjhj1-ospf-1]area 2
[jrjhj1-ospf-1-area-0.0.0.2]network 192.168.7.0 0.0.0.255
[jrjhj1-ospf-1-area-0.0.0.2]q
[jrjhj1-ospf-1]
[jrjhj1-ospf-1]area 3
[jrjhj1-ospf-1-area-0.0.0.3]network 192.168.8.0 0.0.0.255
[jrjhj1-ospf-1-area-0.0.0.3]q

结果:

<jrjhj1>dis cur
#
sysname jrjhj1
#
vlan batch 2 to 7
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
 ip address 192.168.254.2 255.255.255.0
#
interface Vlanif5
 ip address 192.168.6.254 255.255.255.0
#
interface Vlanif6
 ip address 192.168.7.254 255.255.255.0
#
interface Vlanif7
 ip address 192.168.8.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type access
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 5
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 6
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 7
#
interface GigabitEthernet0/0/5
#
...
ospf 1
 area 0.0.0.0
  network 192.168.254.0 0.0.0.255
 area 0.0.0.1
  network 192.168.6.0 0.0.0.255
 area 0.0.0.2
  network 192.168.7.0 0.0.0.255
 area 0.0.0.3
  network 192.168.8.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
port-group link-type
#
return

 

HXJHJ2

结果:

<jrjhj2>dis cur
#
sysname jrjhj2
#
vlan batch 2 to 10
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
 authentication-scheme default
 authorization-scheme default
 accounting-scheme default
 domain default
 domain default_admin
 local-user admin password simple admin
 local-user admin service-type http
#
interface Vlanif1
 ip address 192.168.254.3 255.255.255.0
#
interface Vlanif8
 ip address 192.168.9.254 255.255.255.0
#
interface Vlanif9
 ip address 192.168.10.254 255.255.255.0
#
interface Vlanif10
 ip address 192.168.11.254 255.255.255.0
#
interface MEth0/0/1
#
interface GigabitEthernet0/0/1
 port link-type access
#
interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 8
#
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 9
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 10
#
...
interface NULL0
#
ospf 1
 area 0.0.0.0
  network 192.168.254.0 0.0.0.255
 area 0.0.0.1
  network 192.168.9.0 0.0.0.255
 area 0.0.0.2
  network 192.168.10.0 0.0.0.255
 area 0.0.0.3
  network 192.168.11.0 0.0.0.255
#
user-interface con 0
user-interface vty 0 4
#
return

PC

  以PC4为例

技术分享图片

  ping

技术分享图片

 

实现:

1.给每种服务器创建不同VLAN划分

2.pc1和pc2可以互相访问

3.pc3-pc11之间可以互相访问

 

网络拓扑图练习

标签:服务器   ima   1.2   null   color   user   outer   ping   access   

原文地址:https://www.cnblogs.com/yinfutao/p/9749207.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!