
내 네트워크는 다음과 같습니다.
나는 문제를 해결하기 위해 최선을 다했지만 성공하지 못했습니다. 패킷이 LAN 1 또는 LAN 3에서 올 때마다 로컬 IP 주소는 각 라우터가 사용할 수 있는 3개의 공용 주소 중 하나로 변환되지만 LAN 2 또는 4의 패킷은 라우터에 의해 즉시 삭제됩니다. 변환을 위한 IP 주소입니다. 패킷을 삭제합니다."
따라서 패킷은 LAN 1과 3에서 라우팅되지만 다시는 돌아오지 않습니다. 라우터는 패킷에 대상으로 설정된 공용 IP 주소를 패킷을 보낸 시스템의 올바른 개인 IP로 변환할 수 없습니다. 예를 들어, LAN 1에서 LAN 3으로의 핑(앞서 언급한 LAN 2와 4는 즉시 패킷을 삭제함)이 Router0에서 앞뒤로 올바르게 이동하지만 그 다음에는 동일한 Router0이 응답 대상이 다음 중 하나임을 확인합니다. 해당 인터페이스 주소는 ping을 보낸 적이 없으며 에코 응답을 기다리지 않는다는 패킷을 삭제합니다. 뭔가 빠졌을 수도 있고 NAT와 PAT가 실제로 어떻게 작동하는지 여전히 완전히 이해할 수 없다는 점을 인정합니다(불행히도 선생님은 전혀 도움이 되지 않습니다). 그러나 모든 것이 작동하도록 하려면 어디서부터 시작해야 할지 모르겠습니다.
이제 4개의 라우터 시작 구성을 게시하겠습니다.
라우터0
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
ip address 200.200.0.1 255.255.255.252
ip nat outside
clock rate 64000
!
interface Serial3/0
ip address 200.200.3.2 255.255.255.252
ip nat outside
!
interface FastEthernet4/0
ip address 200.200.4.1 255.255.255.252
ip nat outside
!
interface FastEthernet5/0
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 200.200.0.0 0.0.0.3 area 0
network 200.200.4.0 0.0.0.3 area 0
network 200.200.3.0 0.0.0.3 area 0
!
ip nat inside source list 101 interface FastEthernet4/0 overload
ip classless
!
ip flow-export version 9
!
!
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
라우터1
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
ip address 200.200.3.1 255.255.255.252
ip nat outside
clock rate 64000
!
interface Serial3/0
ip address 200.200.2.2 255.255.255.252
ip nat outside
!
interface FastEthernet4/0
ip address 200.200.5.2 255.255.255.252
ip nat outside
!
interface FastEthernet5/0
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 200.200.3.0 0.0.0.3 area 0
network 200.200.5.0 0.0.0.3 area 0
network 200.200.2.0 0.0.0.3 area 0
!
ip nat inside source list 101 interface FastEthernet4/0 overload
ip classless
!
ip flow-export version 9
!
!
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
라우터2
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
ip address 200.200.1.1 255.255.255.252
ip nat outside
clock rate 64000
!
interface Serial3/0
ip address 200.200.0.2 255.255.255.252
ip nat outside
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
ip address 200.200.5.1 255.255.255.252
ip nat outside
!
router ospf 1
log-adjacency-changes
network 200.200.1.0 0.0.0.3 area 0
network 200.200.5.0 0.0.0.3 area 0
network 200.200.0.0 0.0.0.3 area 0
!
ip nat inside source list 101 interface FastEthernet4/0 overload
ip classless
!
ip flow-export version 9
!
!
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
라우터3
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Serial2/0
ip address 200.200.2.1 255.255.255.252
ip nat outside
clock rate 64000
!
interface Serial3/0
ip address 200.200.1.2 255.255.255.252
ip nat outside
!
interface FastEthernet4/0
no ip address
shutdown
!
interface FastEthernet5/0
ip address 200.200.4.2 255.255.255.252
ip nat outside
!
router ospf 1
log-adjacency-changes
network 200.200.2.0 0.0.0.3 area 0
network 200.200.4.0 0.0.0.3 area 0
network 200.200.1.0 0.0.0.3 area 0
!
ip nat inside source list 101 interface FastEthernet4/0 overload
ip classless
!
ip flow-export version 9
!
!
access-list 101 permit ip any any
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
미리 감사드립니다.
답변1
당신의낫명령라우터2그리고라우터3틀렸어 :
ip nat inside source list 101 interface FastEthernet4/0 overload
이 명령을 두 라우터 모두에 제공했습니다. 그러나 실제 wan 인터페이스는패스트이더넷5/0. 당신의낫두 라우터의 명령은 다음과 같아야 합니다.
ip nat inside source list 101 interface FastEthernet5/0 overload
둘째,
모든 wan 인터페이스(직렬)에 대해 외부에서 ip nat를 구성했지만 라우터당 NATing 명령에 지정된 인터페이스는 하나만 있습니다.
따라서 재라우팅(다른 경로를 통해 라우팅된 패킷)의 경우밖의인터페이스), 패킷의 소스 주소는 NAT되지 않습니다.
이 문제를 해결하려면 하나의 NAT 명령이 필요합니다.당완 인터페이스. 따라서 먼저 동일한 소스 LAN에 대해 별도의 ACL을 생성하고 각 NAT 명령에 하나의 acl을 적용해야 합니다.
예를 들어:
Router3에서
!
interface FastEthernet1/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
!
interface Serial2/0
ip address 200.200.2.1 255.255.255.252
ip nat outside
!
interface Serial3/0
ip address 200.200.1.2 255.255.255.252
ip nat outside
!
!
interface FastEthernet5/0
ip address 200.200.4.2 255.255.255.252
ip nat outside
!
ip nat inside source list 101 interface FastEthernet5/0 overload
ip nat inside source list 102 interface Serial2/0 overload
ip nat inside source list 103 interface Serial3/0 overload
!
access-list 101 permit ip any any
access-list 102 permit ip any any
access-list 103 permit ip any any