04-08-2018 02:49 PM - edited 03-08-2019 02:34 PM
Hello,
I need to connect two host from different networks.
It looks like below.
Network 1:
192.168.1.0/24 default gateway: 192.168.1.1
My host 192.168.1.100
Network 2:
172.16.1.0/24 default gateway 172.16.1.1
My host 172.16.1.80
I need to communicate between host 192.168.1.100 and 172.16.1.80. I don't have access for network 1 and network 2 routers configuration.
Is it possible to communicate between this two hosts without changing existing routers config? I can use any new device between this networks.
Solved! Go to Solution.
04-09-2018 08:52 AM
Ok.
Hope that you can have 2 IPs from each subnets?
The only simple solution I can see is to use nat:
Let's say 172.16.1.100 host is natted to 192.168.1.253 and hosts from 192.168.1.0 are natted to 172.16.1.253
You'll have a router with 1 interface on 192.168.1.0/24 and the other in 172.16.1.0/24.
In my example, interface e0/0 has IP 192.168.1.254 and e0/1 has 172.16.1.254.
Here a config sample:
interface Ethernet0/1
ip address 172.16.1.254 255.255.255.0
ip nat enable
!
interface Ethernet0/0
ip address 192.168.1.254 255.255.255.0
ip nat enable
!
access-list 100 permit ip 192.168.1.0 0.0.0.255 any --> For simplicity I use the complete subnet. If you want to restrict to only few hosts, you can configure this acl with specifics IPs
!
ip nat pool POOL 172.16.1.253 172.16.1.253 netmask 255.255.255.0
ip nat source list 100 pool POOL overload
ip nat source static 172.16.1.100 192.168.1.253
Now, to reach your remote host 172.16.1.100 from host 192.168.1.100, do ping 192.168.1.253.
As you can see on the following wireshark, the source host is natted into 172.16.1.253
04-08-2018 04:30 PM
Hi
You have access to the 2 hosts but not on the local default gateway router.
You don't want to break anything but you would like to get these 2 hosts communicating together.
What you can do is add a router with an interface on 192.168.1.0/24 subnet and the other interface on 172.16.1.0/24 subnet. Let's assume you configure those interfaces with IP 192.168.1.254 and 172.16.1.254.
As you have access to hosts you can add a local route on each host:
- route for host in 192.168.1.0/24 --> route for 172.16.1.0/24, gw is 192.168.1.254
- route for host in 172.16.1.0/24 --> route for 192.168.1.0/24, gw is 172.16.1.254
04-09-2018 03:26 AM
04-09-2018 08:52 AM
Ok.
Hope that you can have 2 IPs from each subnets?
The only simple solution I can see is to use nat:
Let's say 172.16.1.100 host is natted to 192.168.1.253 and hosts from 192.168.1.0 are natted to 172.16.1.253
You'll have a router with 1 interface on 192.168.1.0/24 and the other in 172.16.1.0/24.
In my example, interface e0/0 has IP 192.168.1.254 and e0/1 has 172.16.1.254.
Here a config sample:
interface Ethernet0/1
ip address 172.16.1.254 255.255.255.0
ip nat enable
!
interface Ethernet0/0
ip address 192.168.1.254 255.255.255.0
ip nat enable
!
access-list 100 permit ip 192.168.1.0 0.0.0.255 any --> For simplicity I use the complete subnet. If you want to restrict to only few hosts, you can configure this acl with specifics IPs
!
ip nat pool POOL 172.16.1.253 172.16.1.253 netmask 255.255.255.0
ip nat source list 100 pool POOL overload
ip nat source static 172.16.1.100 192.168.1.253
Now, to reach your remote host 172.16.1.100 from host 192.168.1.100, do ping 192.168.1.253.
As you can see on the following wireshark, the source host is natted into 172.16.1.253
04-09-2018 10:43 AM
That is exacltly what I need!
Thank you for help!
04-09-2018 06:23 PM
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