NAT Practice With BGP and PBR: Lab Topology
NAT Practice With BGP and PBR: Lab Topology
PNETLAB Store
PNETLab.com
https://user.pnetlab.com/store/labs/detail?id=16042993804260
Lab Objective:
The objective of this lab exercise is for you to learn and understand NAT in real world.
Task:
Our Company have 2 vlans:
Vlan 10 for server: 10.1.13.0/24 (R1)
Vlan 20 for user: 10.1.23.0/24 (R2)
R3 is Router Gateway and it will NAT all inside to IP 123.31.36.0/24
1
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Solution
Basic Configuration:
Router R1 R2
Configuration interface Ethernet0/0 interface Ethernet0/0
no shutdown no shutdown
ip address 10.1.13.1 255.255.255.0 ip address 10.1.23.2 255.255.255.0
! !
ip route 0.0.0.0 0.0.0.0 10.1.13.3 ip route 0.0.0.0 0.0.0.0 10.1.23.3
Router R3 R4
Configuration interface Ethernet0/0 interface Loopback0
no shutdown no shutdown
no ip address ip address 4.4.4.4 255.255.255.255
! !
interface Ethernet0/0.10 interface Ethernet0/0
no shutdown no shutdown
encapsulation dot1Q 10 ip address 10.1.34.4 255.255.255.0
ip address 10.1.13.3 255.255.255.0 !
! router bgp 2
interface Ethernet0/0.20 bgp log-neighbor-changes
no shutdown neighbor 10.1.34.3 remote-as 1
encapsulation dot1Q 20
ip address 10.1.23.3 255.255.255.0
!
interface Ethernet0/1
no shutdown
ip address 10.1.34.3 255.255.255.0
!
2
Download PNETLab Platform
PNETLAB Store
PNETLab.com
router bgp 1
bgp log-neighbor-changes
neighbor 10.1.34.4 remote-as 2
Router SW
Configuration vlan 10
!
Vlan 20
!
interface Ethernet0/0
no shutdown
switchport access vlan 10
switchport mode access
!
interface Ethernet0/1
no shutdown
switchport access vlan 20
switchport mode access
!
interface Ethernet0/2
no shutdown
switchport trunk encapsulation dot1q
switchport mode trunk
Configured NAT
R4(config)#router bgp 2
R4(config-router)#net 4.4.4.4 mask 255.255.255.255
Let’s check:
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/2 ms
R2#ping 4.4.4.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
4
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R4#ping 123.31.36.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.31.36.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
R2#ping 123.31.36.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.31.36.1, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
5
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R3(config)#interface e0/0.10
R3(config-subif)#ip policy route-map R2R1
R3(config-subif)#interface e0/0.20
R3(config-subif)#ip policy route-map R2R1
I have pushed all packet from Inside that want to reach 123.31.36.0/24 to next-hop 10.1.34.4. Let’s
check again:
R2#ping 123.31.36.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 123.31.36.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/5 ms
R2#traceroute 123.31.36.1
Type escape sequence to abort.
Tracing the route to 123.31.36.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.1.23.3 3 msec 1 msec 1 msec
2 10.1.34.4 3 msec 1 msec 2 msec
3 10.1.34.3 1 msec 5 msec 4 msec
4 * * *