1. 程式人生 > 實用技巧 >簡單三層網路配置

簡單三層網路配置

拓撲圖:

wKioL1csKNewphEJAAAxpyW1eAc825.png

R1(ISP)配置:

Router#sh run

Building configuration...


Current configuration : 702 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

license udi pid CISCO2911/K9 sn FTX15247M9Z

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface GigabitEthernet0/0

ip address 1.85.15.45 255.255.255.248

duplex auto

speed auto

!

interface GigabitEthernet0/1

no ip address

duplex auto

speed auto

shutdown

!

interface GigabitEthernet0/2

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



Router#

R0配置:

Router#sh run

Building configuration...


Current configuration : 926 bytes

!

version 15.1

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Router

!

!

!

!

!

!

!

!

ip cef

no ipv6 cef

!

!

!

!

license udi pid CISCO2911/K9 sn FTX152474AG

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface GigabitEthernet0/0

ip address 192.168.100.1 255.255.255.0

ip nat inside

duplex auto

speed auto

!

interface GigabitEthernet0/1

ip address 1.85.15.46 255.255.255.248

ip nat outside

duplex auto

speed auto

!

interface GigabitEthernet0/2

no ip address

duplex auto

speed auto

shutdown

!

interface Vlan1

no ip address

shutdown

!

ip nat inside source list 10 interface GigabitEthernet0/1 overload

ip classless

ip route 0.0.0.0 0.0.0.0 1.85.15.45

ip route 192.168.0.0 255.255.0.0 192.168.100.2

!

ip flow-export version 9

!

!

access-list 10 permit any

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



Router#

SW配置:

Switch#sh run

Building configuration...


Current configuration : 1754 bytes

!

version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname Switch

!

!

!

!

!

ip dhcp pool 101

network 192.168.101.0 255.255.255.0

default-router 192.168.101.1

dns-server 114.114.114.114

ip dhcp pool 102

network 192.168.102.0 255.255.255.0

default-router 192.168.102.1

dns-server 114.114.114.114

!

!

ip routing

!

!

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

!

!

interface FastEthernet0/1

switchport access vlan 100

!

interface FastEthernet0/2

switchport access vlan 101

!

interface FastEthernet0/3

switchport access vlan 102

!

interface FastEthernet0/4

switchport access vlan 102

!

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

!

interface GigabitEthernet0/1

!

interface GigabitEthernet0/2

!

interface Vlan1

no ip address

shutdown

!

interface Vlan100

ip address 192.168.100.2 255.255.255.0

!

interface Vlan101

ip address 192.168.101.1 255.255.255.0

!

interface Vlan102

ip address 192.168.102.1 255.255.255.0

!

interface Vlan103

ip address 192.168.103.1 255.255.255.0

!

ip classless

ip route 0.0.0.0 0.0.0.0 192.168.100.1

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!

end



Switch#

轉載於:https://blog.51cto.com/wanglei1024/1770715