01-29-2018 03:14 AM - edited 03-05-2019 09:50 AM
hi i have this topology
linux: 10.2.2.100
win : 10.2.2.50
i also have two loopback interfaces
loop1 : 1.1.1.1 255.255.255.255
loop2 : 2.2.2.2 255.255.255.255
both interfaces have ip nat outside under config
and i have these nats as well
ip nat inside source static 10.2.2.50 interface loop 1
ip nat inside source static 10.2.2.100 interface loop 2
now i want to connect to my window machine from Linux on 1.1.1.1 ip address
but i cant
how can i do that ?
01-29-2018 03:46 AM - edited 01-29-2018 07:07 AM
Hi
The switches cannot run NAT, it should be configured on the router, so your configuration should be:
ROUTER
interface loopback 1
ip address 1.1.1.1 255.255.255.255
interface loopback 2
ip address 2.2.2.2 255.255.255.255
interface g0/0
description >>INTERNAL NETWORK<<
ip nat inside
interface g0/1
description >>INTERNET or EXTERNAL NETWORK<<
ip nat outside
ip nat inside source static 10.2.2.50 <interface loop 1 IP address>
ip nat inside source static 10.2.2.100 <interface loop 2 IP address>
ip route 0.0.0.0 0.0.0.0 <public or next hop IP>
** Now if it is used to translate to Internet, the IP addresses used with the loopback should be public IP addresses provided by an ISP.
Hope it is useful
:-)
01-29-2018 04:24 AM
01-29-2018 04:24 AM
01-29-2018 04:56 AM
Hi,
Thank you, thas is correct.
01-29-2018 06:25 AM
As sir Julio confirmed config is okay, just give it a try with IP address instead than interface(s).
ip nat inside source static 10.2.2.50 1.1.1.1
ip nat inside source static 10.2.2.100 2.2.2.2
Thank you.
Kindest regards,
Uzzi
01-29-2018 07:08 AM
Thank you Muhammad, you are right, it was fixed
:-)
01-29-2018 10:43 AM
01-29-2018 10:45 AM
Hi
Could you please share your configuration, switch and router
Thank you
01-29-2018 10:49 AM
01-29-2018 10:59 AM - edited 01-29-2018 11:02 AM
Hi
The loopback address must be known through the next hop, for example:
SWITCH ----- ROUTER (cient) ---- ROUTER (ISP)
ROUTER (client)
* IP nat outside is not required under the loopback interfaces, it can be removed
* You need to add a default route: 0.0.0.0 0.0.0.0 <next hop IP - ISP router interface IP address>
something like:
ip route 0.0.0.0 0.0.0.0 172.18.1.2
The IPS's router must know the following IP addresses:
1.1.1.1/32
2.2.2.2/32
so you could create:
ip route 1.1.1.1 255.255.255.255 <next-hop IP - Client's router Interface IP>
ip route 2.2.2.2 255.255.255.255 <next-hop IP - Client's router Interface IP>
Hope it is useful
:-)
01-29-2018 12:19 PM - edited 01-29-2018 12:27 PM
Hello
Not sure if you wanted the loopbacks of the rrtr to be natted to a static 172.18.1 x address however in the example below i have applied such nat.
You also have some mis-configuration on the switch regards the vlans and connection to the rtr.
see example below:
Switch:
conf t
ip routing
interface Vlan1
no shutdown
no ip route 0.0.0.0 0.0.0.0 10.1.1.2
ip route 0.0.0.0 0.0.0.0 vlan 1 10.1.1.2
Router :
conf t
ip route 10.2.2.0 255.255.255.0 gig0/0 10.1.1.1
ip route 0.0.0.0 0.0.0.0 gig0/1 172.18.1.x < isp lan facing ip address)
interface Loopback1
ip nat inside
interface Loopback2
ip nat inside
interface GigabitEthernet0/0
ip nat inside
interface GigabitEthernet0/1
ip nat outside
no ip nat inside source static 10.2.2.50 interface Loopback2
no ip nat inside source static 10.2.2.100 1.1.1.1
no ip access-list standard NAT
ip access-list standard NAT
permit ip 10.1.1.0 0.0.0.255 any
permit ip 10.2.2.0 0.0.0.255 any
ip nat source static 1.1.1.1 172.18.1.x
ip nat source static 2.2.2.2 172.18.1.x
res
Paul
01-30-2018 11:52 AM
thanks to all you guys for your replies but they are not what i look for and also don't work
this is my network i have no other stuff
i want to connect to server 2 from server 1 but with 1.1.1.1 ip address which is set on my routers loopback it is fully working when i connect to the server from the internet but when i do it from server 1 it fails and when i telnet to 1.1.1.1 from server 1 the router cli opens up witch i don't want
so what can i do to :
telnet from server 1 to 1.1.1.1 and my server 2 cli opens not the router.
01-30-2018 11:53 AM
i also tried a bunch of other ios versions and other routers they are all do the same
01-31-2018 02:04 AM - edited 01-31-2018 02:06 AM
Hello
thrn you will need to nat hairpin to achieve that
https://supportforums.cisco.com/t5/wan-routing-and-switching/nat-hairpinning/td-p/2475807
Res
paul
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide