楼主,你好哇~
配置如下
路由器B
hostname RouterB
interface FastEthernet0/0
ip address 120.100.20.1 255.255.255.252
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 8.8.8.1 255.255.255.252
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip nat inside source static tcp 8.8.8.2 80 120.100.20.1 80
ip classless
ip route 0.0.0.0 0.0.0.0 120.100.20.2
!
ip flow-export version 9
!
!
access-list 1 permit 8.8.8.0 0.0.0.3
路由器A配置如下
interface FastEthernet0/0
ip address 120.100.20.2 255.255.255.252
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.168.0.1 255.255.255.252
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 120.100.20.1
ip route 192.168.0.0 255.255.0.0 172.168.0.2
!
ip flow-export version 9
!
!
access-list 1 permit 192.168.0.0 0.0.255.255
汇聚交换机配置如下
interface FastEthernet0/1
switchport access vlan 2
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
ip address 172.168.0.2 255.255.255.252
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
interface Vlan30
ip address 192.168.30.1 255.255.255.0
!
interface Vlan40
ip address 192.168.40.1 255.255.255.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.168.0.1
接入交换机配置如下
interface FastEthernet0/1
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
switchport access vlan 30
switchport mode access
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
switchport access vlan 40
switchport mode access
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
no ip address
!
ip default-gateway 172.168.0.2
!
!
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end
PC端IP设置成静态就可以了。
网管机器如果要访问各个设备
可在各设备上加上 line vty
2960上vlan2 设个ip 地址 ,比如172.168.0.3 255.255.255.252就可以访问了。
不懂再问。
把拓扑图传给你哈。
你是不是乱出题