As I said in my previous post, I'm new to NAT. I have this lab scenario set up:
Two routers connected together on 130.0.0.0/8 network. One router is doing NAT (s0 ip address 130.0.0.1, e0 ip address 192.100.30.0/24, treated as private and nat inside), the second is not (s0 ip address 130.0.0.2) and is treated as public conection. Here are their configurations:
Current configuration for router doing NAT:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname router_nat
!
!
no ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Ethernet0
ip address 192.100.30.1 255.255.255.0
no ip directed-broadcast
ip nat inside
no ip mroute-cache
no mop enabled
!
interface Ethernet1
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
!
interface Serial0
ip address 130.0.0.1 255.0.0.0
ip access-group 100 out
no ip directed-broadcast
ip nat outside
no ip mroute-cache
!
interface Serial1
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
!
router eigrp 100
network 130.0.0.0
network 192.100.30.0
!
ip nat pool local 130.0.0.3 130.0.0.3 netmask 255.0.0.0
ip nat inside source list 1 pool local overload
no ip http server
ip classless
!
access-list 1 permit 192.100.30.0 0.0.0.255
!
line con 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
Current configuration for router not doing nat and treated as public network:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname router_nonat
!
!
no ip subnet-zero
!
!
!
!
interface Ethernet0
ip address 194.100.30.1 255.255.255.0
no ip directed-broadcast
!
interface Serial0
ip address 130.0.0.2 255.0.0.0
no ip directed-broadcast
no ip mroute-cache
no fair-queue
clockrate 250000
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
router eigrp 100
network 130.0.0.0
network 194.100.30.0
!
no ip http server
ip classless
!
!
line con 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
Now - I know that when packets are travelling inside to outside, first routing table is checked for destination and then translation occurs. When packets are travelling outside to inside, it is the other way (first translate, then route). The problem is maybe not with configuration of NAT, but I'm able to ping from my "public" router and public hosts to hosts behind the router doing NAT, connected to e0 (nat inside). I think they should not be able to ping, only inside host should (and they can) - is there something wrong with my config? I know I have dynamic routing configured, so my outside "public" router knows about my private routes. But when I turn to static routing, such as "ip route 0.0.0.0 0.0.0.0 s0" on both routers, it is the same effect as when I will leave dynamic routing on. Or maybe it should be working this way, but to block my outside "public" hosts from accessing inside, I would need to configure ACLs. This way it will be possible but it is necessary? Isn't just configuring NAT supposed to be enough? Or there is completely different solution to my problem?
I'm starting to think that I'm missing something small, but very important here. Please I'll be very glad if you can help me. Peter Mesjar
CCNA, A+ certified
pmesjar@centrum.sk
Two routers connected together on 130.0.0.0/8 network. One router is doing NAT (s0 ip address 130.0.0.1, e0 ip address 192.100.30.0/24, treated as private and nat inside), the second is not (s0 ip address 130.0.0.2) and is treated as public conection. Here are their configurations:
Current configuration for router doing NAT:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname router_nat
!
!
no ip subnet-zero
no ip domain-lookup
!
!
!
!
interface Ethernet0
ip address 192.100.30.1 255.255.255.0
no ip directed-broadcast
ip nat inside
no ip mroute-cache
no mop enabled
!
interface Ethernet1
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
!
interface Serial0
ip address 130.0.0.1 255.0.0.0
ip access-group 100 out
no ip directed-broadcast
ip nat outside
no ip mroute-cache
!
interface Serial1
no ip address
no ip directed-broadcast
no ip mroute-cache
shutdown
!
router eigrp 100
network 130.0.0.0
network 192.100.30.0
!
ip nat pool local 130.0.0.3 130.0.0.3 netmask 255.0.0.0
ip nat inside source list 1 pool local overload
no ip http server
ip classless
!
access-list 1 permit 192.100.30.0 0.0.0.255
!
line con 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
Current configuration for router not doing nat and treated as public network:
!
version 12.0
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname router_nonat
!
!
no ip subnet-zero
!
!
!
!
interface Ethernet0
ip address 194.100.30.1 255.255.255.0
no ip directed-broadcast
!
interface Serial0
ip address 130.0.0.2 255.0.0.0
no ip directed-broadcast
no ip mroute-cache
no fair-queue
clockrate 250000
!
interface Serial1
no ip address
no ip directed-broadcast
shutdown
!
router eigrp 100
network 130.0.0.0
network 194.100.30.0
!
no ip http server
ip classless
!
!
line con 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
end
Now - I know that when packets are travelling inside to outside, first routing table is checked for destination and then translation occurs. When packets are travelling outside to inside, it is the other way (first translate, then route). The problem is maybe not with configuration of NAT, but I'm able to ping from my "public" router and public hosts to hosts behind the router doing NAT, connected to e0 (nat inside). I think they should not be able to ping, only inside host should (and they can) - is there something wrong with my config? I know I have dynamic routing configured, so my outside "public" router knows about my private routes. But when I turn to static routing, such as "ip route 0.0.0.0 0.0.0.0 s0" on both routers, it is the same effect as when I will leave dynamic routing on. Or maybe it should be working this way, but to block my outside "public" hosts from accessing inside, I would need to configure ACLs. This way it will be possible but it is necessary? Isn't just configuring NAT supposed to be enough? Or there is completely different solution to my problem?
I'm starting to think that I'm missing something small, but very important here. Please I'll be very glad if you can help me. Peter Mesjar
CCNA, A+ certified
pmesjar@centrum.sk