1

I'm a newbie in network stuff and haven't enough knowledge to do what I'm wanting for now, so I need your help, please.

I've two networks, a wired and another wireless.

The wired one is between two computers that acts as routers/gateways. The first one receives provider's Internet link and routes to second, which manages a wireless network and routes Internet to it's clients.

                         |            |    wired     |            |    wireless    | Client
[Internet link] ======== | Computer 1 | ============ | Computer 2 | ============== | Client
                         |            |              |            |                | etc.

Currently, wired network has a /30 IP range and wireless a /24. They are distinct ranges (i.e. 192.168.45.0/30 for wired and 172.16.45.0/24 for wireless). This setting doesn't allow Clients reach Computer 1 or vice versa.

What I want is to have everything within the same IP range, making possible Computer 1 reach Computer 2 and Clients, Clients reach Computer 2 and Computer 1 and Computer 2 reach Computer 1 and Clients. Ultimately, everyone be able to communicate with everyone.

How can I make this? I've searched a lot but found nothing useful, maybe I'm not searching for right term.

1
  • 2
    That requires bridging, and how to configure it depends on your OS. – Ben Voigt Mar 2 '14 at 1:01
1

For outbound traffic (going from right to left in your diagram) you just need to make sure each machine has a default gateway set which matches the next hop IP e.g. the clients will have computer2 as their default gateway, computer2 will have computer1 as its default gateway and so on. For traffic going in the other direction (from left to right) all you need is for computer1 to have a static route that tells it which next hop to use to send traffic destined for 172.16.45.0/24; in your case that is computer2. So the route command on computer1 would be something like

$ route add -net 172.16.45.0/24 gw 192.168.45.x

computer2 doesn't need a static route for 172.16.45.0/24 as it is directly connected to that network


EDIT

What I want is to have everything within the same IP range,

You could use the free remaining addresses in the 192.168.45.x range, however you need to choose a subnet that does not overlap the existing subnet 192.168.45.0/30. The best choice would be 192.168.45.128/25 as that gives you the most usable addresses (125):

network:    192.168.45.128
broadcast:  192.168.45.255
subnet:     255.255.255.128
usable IPs: 192.168.45.129 - 192.168.45.254
2
  • Thanks, this appear to solve the routing problem. But what about to have both networks under same IP range? Ex.: [Network 1 -> Network: 192.168.45.0; Netmask: 255.255.255.252; Available IPs: 192.168.45.1-2; Broadcast: 192.168.45.3] [Network 2 -> Network: 192.168.45.4; Netmask: 255.255.255.128; Available IPs: 192.168.45.5-131; Broadcast: 192.168.45.132] Can I do this? If yes, will this setting allow everyone-to-everyone communication as I'm wanting? Thanks, bye. – Tiago.SR Mar 1 '14 at 23:30
  • [Network 2 -> Network: 192.168.45.4; Netmask: 255.255.255.128; Available IPs: 192.168.45.5-131; Broadcast: 192.168.45.132] That is not a valid network for 2 reasons: a) it overlaps with the existing subnet and would cause a conflict b) the broadcast address 192.168.45.132 is not possible with netmask 255.255.255.128 – IanB Mar 2 '14 at 3:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.