如上图:
ip地址设置如图再次不再写命令
waiwang路由器设置如下:
Router#sh run
Building configuration...
Current configuration : 550 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet0/1
ip address 58.251.138.45 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 2.2.2.0 255.255.255.0 58.251.138.46
neiwang路由设置
Building configuration...
Current configuration : 656 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
ip dhcp pool 123
network 2.2.2.0 255.255.255.0
default-router 2.2.2.1
dns-server 2.2.2.1
!
spanning-tree mode pvst
!
interface FastEthernet0/0
ip address 2.2.2.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 58.251.138.46 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 58.251.138.0 255.255.255.0 58.251.138.45
测试结果