
これは私のネットワークです:
私はこの問題を解決するために最善を尽くしましたが、成功しませんでした。LAN 1 または LAN 3 からパケットが来ると、ローカル IP アドレスは各ルーターが使用できる 3 つのパブリック アドレスの 1 つに変換されますが、LAN 2 または 4 からのパケットは、ルーターによって「デバイスは変換に使用できる IP アドレスを割り当てることができません。パケットをドロップします。」と表示され、すぐにドロップされます。
したがって、パケットは LAN 1 と 3 からルーティングされますが、戻ってくることはありません。ルータは、パケットの宛先として設定されたパブリック IP アドレスを、パケットを送信したマシンの正しいプライベート IP に変換できません。たとえば、LAN 1 から LAN 3 (前述のように、LAN 2 と 4 はすぐにパケットをドロップします) への ping は Router0 から正しく往復しますが、同じ Router0 は、応答の宛先がインターフェイス アドレスの 1 つであることを確認すると、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 outside を設定していますが、ルータごとに NAT コマンドで指定されているインターフェイスは 1 つだけです。
そのため、再ルーティング(別の外インターフェイスの場合、パケットの送信元アドレスは NAT されません。
これを解決するには、1つのNATコマンドが必要ですあたりWAN インターフェイス。したがって、最初に個別の ACL (同じソース LAN 用) を作成し、各 NAT コマンドに 1 つの ACL を適用する必要があります。
例えば:
ルータ3
!
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