[SOLVED] access multiple router/modem with connected to single PC

Jul 1, 2020
5
0
10
Hi Guys,
I have looking for some solution/way where I can test multiple router connected to single PC, running at the same time by generating multiple thread via any code or programming language.

is it possible to achieve? or if there any other better way?

Kindly help!
 
Solution
This is not a beginner thing. What you are doing is not very standard making it even more complex. You will have lots of studying to do.

The largest issue is getting a router that has enough physical interfaces to plug in you test routers. Devices that have more than just a couple are extremely expensive. Then again commercial firewalls are expensive to start with.

Your cheapest option is likely a dual nic pc running on of the free firewall images. The to get more ports use a switch that supports vlans. vlans and virtual interfaces rather than physical ones adds another level of complexity.

The exact syntax depends on what platform you choose but most pc based solutions use IPTABLES commands. I hate IPTABLES because...
Jul 1, 2020
5
0
10
I am setting up test automation setup for routers and modems provided by different third-party vendor. And, My goal to perform parallel execution on all the devices(routers) connected to single windows PC.

So, my question is, Is it possible to connect multiple routers to the single PC and should be able to access or login in all different routers GUI using same Ip address ex(192.168.1.254) with the same SSID and passphrase.

and if this is possible then If anyone having any idea how to automate this for example(any programming language like..python, power shell.etc)
 
You can't duplicate the IP addresses. If you use the same SSID you will have no control at all over which router you connect to.

If for example you had a bunch of routers connected to different ISP you could number them say 192.168.1.1 192.168.1.2 etc. You could change the gateway to decide which you connect to.

If you say wanted to run a bunch of routers with default out of the box config where they all have the same IP it is going to be messy. You can do it with a actual router that has advanced NAT ability and hide the duplicate IP addresses and duplicate interface addresses. You are likely going to have to NAT the ip multiple times and use some kind of policy based routing rather than rely on a routing table.
 
Jul 1, 2020
5
0
10
You can't duplicate the IP addresses. If you use the same SSID you will have no control at all over which router you connect to.

If for example you had a bunch of routers connected to different ISP you could number them say 192.168.1.1 192.168.1.2 etc. You could change the gateway to decide which you connect to.

If you say wanted to run a bunch of routers with default out of the box config where they all have the same IP it is going to be messy. You can do it with a actual router that has advanced NAT ability and hide the duplicate IP addresses and duplicate interface addresses. You are likely going to have to NAT the ip multiple times and use some kind of policy based routing rather than rely on a routing table.

I think I do understand what you just suggested above. However, I think it was my mistake that I did not put question clearly I think. So, with SSID I did not mean the default one behind the box. For router we are using to test we have set same username and password to login in different router GUI. Since, I am quite new to this device based testing technology, I am not sure how can I achieve this "NAT ability" to hide the duplicate IP address. So, could you please @bill001g elaborate on the same on how can I achieve this while connecting multiple routers on the single PC.
 

USAFRet

Titan
Moderator
I think I do understand what you just suggested above. However, I think it was my mistake that I did not put question clearly I think. So, with SSID I did not mean the default one behind the box. For router we are using to test we have set same username and password to login in different router GUI. Since, I am quite new to this device based testing technology, I am not sure how can I achieve this "NAT ability" to hide the duplicate IP address. So, could you please @bill001g elaborate on the same on how can I achieve this while connecting multiple routers on the single PC.
If you set them all to the same SSID, how will you tell which one you are connected to?
 
Jul 1, 2020
5
0
10
If you set them all to the same SSID, how will you tell which one you are connected to?
You are right! so what I meant was not actually SSID it is the username and password for GUI login of devices and the username is always "admin" and we have set password same for all the devices. So indeed SSID name and password id still different for all the devices
 
This is not a beginner thing. What you are doing is not very standard making it even more complex. You will have lots of studying to do.

The largest issue is getting a router that has enough physical interfaces to plug in you test routers. Devices that have more than just a couple are extremely expensive. Then again commercial firewalls are expensive to start with.

Your cheapest option is likely a dual nic pc running on of the free firewall images. The to get more ports use a switch that supports vlans. vlans and virtual interfaces rather than physical ones adds another level of complexity.

The exact syntax depends on what platform you choose but most pc based solutions use IPTABLES commands. I hate IPTABLES because it is confusing but it is what all linux based solution use.

So generically what you need to do is NAT the destination address to the actual router IP which likely has the duplicate IP issue. The destination ip address before the nat will be the fake IP in your real network you use to identify the routers. You likely also have to NAT the source ip because many consumer router will not route a different subnet back on the lan. So you must make it appear as though your source IP was coming from the virtual interface on your NAT router.

So that is the NAT part. You nat both the source and destination IP which is very confusing to think about. Next you have to do the routing part. Normal routing is done after the nat but you can't do that because the ip are duplicated. You must force the routing choice to be done before the nat. You also must put in routes that route the fake address to the interfaces. You might be able to just use a policy route and assign a interface directly I forget if the linux iptables has that option.

This is not something trivial you are making a spaghetti mess out of the traffic by NAT with duplicate ip addresses.
 
  • Like
Reactions: Shiven09
Solution
Jul 1, 2020
5
0
10
This is not a beginner thing. What you are doing is not very standard making it even more complex. You will have lots of studying to do.

The largest issue is getting a router that has enough physical interfaces to plug in you test routers. Devices that have more than just a couple are extremely expensive. Then again commercial firewalls are expensive to start with.

Your cheapest option is likely a dual nic pc running on of the free firewall images. The to get more ports use a switch that supports vlans. vlans and virtual interfaces rather than physical ones adds another level of complexity.

The exact syntax depends on what platform you choose but most pc based solutions use IPTABLES commands. I hate IPTABLES because it is confusing but it is what all linux based solution use.

So generically what you need to do is NAT the destination address to the actual router IP which likely has the duplicate IP issue. The destination ip address before the nat will be the fake IP in your real network you use to identify the routers. You likely also have to NAT the source ip because many consumer router will not route a different subnet back on the lan. So you must make it appear as though your source IP was coming from the virtual interface on your NAT router.

So that is the NAT part. You nat both the source and destination IP which is very confusing to think about. Next you have to do the routing part. Normal routing is done after the nat but you can't do that because the ip are duplicated. You must force the routing choice to be done before the nat. You also must put in routes that route the fake address to the interfaces. You might be able to just use a policy route and assign a interface directly I forget if the linux iptables has that option.

This is not something trivial you are making a spaghetti mess out of the traffic by NAT with duplicate ip addresses.
Thanks for the details @bill001g . I will try to work it out with NAT. However, first I need to check if the routers/modem we use supports NAT ability or not. Thanks again!