可以这么写,虽然可以实现,但是我估计这么做不好
R1:
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.5.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
!
interface Serial3/0
no ip address
shutdown
!
interface FastEthernet4/0
ip address 100.100.100.2 255.255.255.0
ip nat outside
!
interface FastEthernet5/0
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 192.168.5.0 0.0.0.255 area 0
default-information originate
!
ip nat inside source list 1 interface FastEthernet4/0 overload
ip nat inside source static tcp 192.168.6.2 80 100.100.100.2 80
ip classless
ip route 0.0.0.0 0.0.0.0 100.100.100.1
!
!
access-list 1 permit 192.168.5.0 0.0.0.255
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
R2:
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.7.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
no ip address
shutdown
!
interface Serial3/0
no ip address
shutdown
!
interface FastEthernet4/0
ip address 200.200.19.2 255.255.255.0
ip nat outside
!
interface FastEthernet5/0
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 192.168.7.0 0.0.0.255 area 0
default-information originate
!
ip nat inside source list 1 interface FastEthernet4/0 overload
ip nat inside source static tcp 192.168.8.2 80 200.200.19.2 80
ip classless
ip route 0.0.0.0 0.0.0.0 200.200.19.1
!
!
access-list 1 permit 192.168.30.0 0.0.0.255
access-list 1 permit 192.168.40.0 0.0.0.255