How to best connect these networks

Soybomb

Diamond Member
Jun 30, 2000
9,506
2
81
Okay I have 2 networks, lets say both with a class c. I control the router on network number 2 only. If I want to join these networks so I can pass traffic without using each of their respective internet connections is there a way to do it? If I simply plugged the switches into each other traffic would still hit the internet first since the addresses wouldn't be in their subnet and that would come before arp would find the ip on the lan right? What would you do?
 

randal

Golden Member
Jun 3, 2001
1,890
0
71
The simple way would be to add static routes on the routers for each subnet -- that way RouterA knows that there is a short, good path to NetworkB and vice versa. If you need load balancing, shared internet links, dynamic / multiple ingress and egress into each network, that can be done as well, but it's a little tougher than adding statics.

$.02
randal
 

Soybomb

Diamond Member
Jun 30, 2000
9,506
2
81
I'd love static routes, sadly I can only add them to the router on network 2. Network 1's router I have no control over. I guess I could do static routes on each machine on network 1. Would statics on the individual servers arp though or still just send the traffic to the default gateway?
 

randal

Golden Member
Jun 3, 2001
1,890
0
71
Unless you give all the machines on NetworkB IP addresses from NetworkA's IP space (making NetworkA on LAN), they will still default route to RouterB, which will then go out and around the internet.

Adding routes to each individual host on NetworkB also is not the correct course of action, but may work -- where will you point the routes on HostB? If you point them to an interface on RouterA, that interface will have to have an IP address from NetworkB. That way HostB will send packets to RouterA(intB) (which is available because it's on LAN), then the router will turn that around and deliver it out it's other interface to NetworkA.

HostB -----> (RouterA(IntB.NetworkB)<->RouterA(IntA.NetworkA))------> HostA

This can even be done on a single interface by multihoming or using subinterfaces, which is referred to as a "router on a stick" -- packets enter RouterAInterfaceA on a NetworkB IP address, then exit from RouterAInterfaceA onto NetworkA. This is a not fun scenario.

HostB -----> (RouterA(IntA.NetworkB)<->RouterB(IntA.NetworkA))------> HostA

The only really 'right' answer is to join the routers and add in static routes, requiring no changes on hosts (because then it's not a network issue any more). Adding static routes on hosts is generally frowned upon, but if you can join RouterA onto NetworkB, then yea, it can be done. Hack job at best, though.

$.02
randal
 

Soybomb

Diamond Member
Jun 30, 2000
9,506
2
81
Yeah thats what I figured...this isn't really my desired use either, something I've just been asked to make happen.

All the hosts on network a that need to be reached are behind a freebsd nat box for the most part. If I can make the rules work how I need then I'll just use a third nic in it, assign it a network b address, and setup static routes to point to that IP. The rules for this seem to be a pain.

Ugh.
 

randal

Golden Member
Jun 3, 2001
1,890
0
71
I'm a FreeBSD nut, glad to find somebody else who uses it :) The rules on the fbsd firewall shouldn't be too bad; only as draconian as your coporate/personal/whatever require. As far as I can see, there shouldn't be any special goings-on at all.

Honestly, though, if you're going to be joining the two networks in that way, why not do it all the way and do away with RouterB entirely? That will save you a ton of work on the host side of things (depending on how big these nets are).

$.02
randal
 

Bob151

Senior member
Apr 13, 2000
857
0
0
haha, if you are trying to sneak on, here may be a way;

- DHCP e0, or static it if you can.
- NAT overload/PAT inside hosts to e0.

All your inside hosts appear to be one host on the other network. Of course, this would require a direct attachment to the other network where the hosts are. If you have one interface on the same network, no cooperation of the other's behalf is nessesary, as those hosts will know how to reach your PAT address and port.
 

kylef

Golden Member
Jan 25, 2000
1,430
0
0
Hmmm... everyone's assumptions up to this point is that you would need to configure a static route on Network 1's router (I'll call it "Router 1"). But there are other ways to influence the routing table on Router 1 to achieve what you want.

For instance, if Router 1 is running an interdomain routing protocol (like RIP or OSPF) then you could easily configure your router (Router 2) to run the same protocol and advertise your network to your new neighbor at a lower cost. Router 1 will notice the route advertisement, see the lower cost, and alter its forwarding table to send packets destined for your network via Router 2 rather than its default route (the ISP). Success!

But of course, if Router 1 is set up with static routes to its ISP (which is a possibility), then no amount of route advertisement by Router 2 will convince Router 1 to alter its forwarding table to prefer your path...
 

Bob151

Senior member
Apr 13, 2000
857
0
0
Originally posted by: Soybomb
Yup router 1 is statically routed. It makes me sad.

Well, still, if you can get at least one Ethernet/IP connection to their network, you can NAT overload (PAT) hundreds of addresses on your side to one on their side. No worries. This, of course, depends on your network hardware as well.

 

Bob151

Senior member
Apr 13, 2000
857
0
0

http://www.cisco.com/warp/public/cc/pd/iosw/ioft/iofwft/prodlit/iosnt_qp.htm

Q. What is Port Address Translation (PAT), or "NAT overloading"?

A. Port Address Translation (PAT) or Overloading, is a feature of Cisco IOS NAT and can be used to translate "internal" (inside local) private addresses to one or more "outside" (inside global?usually registered) IP addresses. Unique source port numbers on each translation are used to distinguish between the conversations.

With NAT Overload, a translation table entry containing full address and source port information is created.

---------------------
PAT is not limited to Cisco, its just a link for your reading.

Still, your device(s) (cisco or not) will need to be able to communicate with three logical networks; yours (a), theirs (b), and the Internet.

I'm guessing you don't have a device that can support 3 logical networks. Most home comsumer market stuff only does 2 logical networks, Internet (sometimes called WAN, or Outside) and LAN.

Most consumer market stuff now does NAT overload and SPI. This is great for our security.

Are you trying to stealth onto someone else's network for a free ride or is this a corporate business solution?