{"id":193,"date":"2011-11-22T23:30:00","date_gmt":"2011-11-22T23:30:00","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=193"},"modified":"2018-09-06T22:59:04","modified_gmt":"2018-09-06T22:59:04","slug":"how-to-setting-up-file-and-printer-sharing-between-two-routers","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=193","title":{"rendered":"How To: Setting up File and Printer sharing between two routers"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>We often hear from people who have two (or more!) routers in their  LAN and are trying to get Microsoft File and Printer sharing running  among all their <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computers<\/a>. This ProblemSolver will explain why this doesn&#8217;t work by default and provide some suggestions for working around the problem.<\/p>\n<p>Setting Up<\/p>\n<p><strong>Figure 1<\/strong> shows a two-router LAN configuration that I&#8217;ll use as  an example. This isn&#8217;t the only configuration possible, but it will  serve to illustrate the points I&#8217;ll be making.<\/p>\n<p><a id=\"fig1\" name=\"fig1\"><\/a><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/howto\/two_routers.jpg\" border=\"0\" alt=\"Example of LAN with two routers\" width=\"347\" height=\"353\" \/><br \/>\n<strong>Figure 1: Example of LAN with two routers<\/strong><\/p>\n<p>First, note that the <strong>two routers are set to different base addresses<\/strong> &#8211; the wired <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">router<\/a> to <strong>192.168.1.1<\/strong> and the <a id=\"itxthook3\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">wireless router<\/a> to <strong>192.168.2.1<\/strong>.  This is essential for multi-router setups, since without the different  address ranges, the routers wouldn&#8217;t be able to properly build their  routing tables. These tables control the way that data is handled and  ensure that it is sent to the correct router for delivery to its  connected clients. The use of different base addresses puts each  router&#8217;s attached clients into different Class C subnets.<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/tip_hp.gif\" border=\"0\" alt=\"Tip!\" width=\"16\" height=\"16\" \/> <strong>TIP:<\/strong> Class C subnets have a maximum of 254 IP addresses, have the same first three &#8220;octets&#8221; in their addresses (ex. <strong>192.168.3<\/strong>.X) and use a subnet mask of 255.255.255.0.<\/p><\/blockquote>\n<p>Next, note that the second router (the wireless) has its WAN port  connected to one of the wired router&#8217;s LAN ports via a normal UTP patch  cable, and that it has an IP address in the first router&#8217;s range. I&#8217;ve  shown the wireless router&#8217;s WAN IP as <strong>192.168.1.100<\/strong>, but it could be any IP address in the 192.168.1.X subnet.<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/tip_hp.gif\" border=\"0\" alt=\"Tip!\" width=\"16\" height=\"16\" \/> <strong>TIP:<\/strong> You don&#8217;t have to use the 192.168.X subnets shown in the example. You  can use any two private IP address ranges as long as they are different.<\/p><\/blockquote>\n<p>Note also that you can either assign the second router&#8217;s WAN IP  statically, or just set it to be a DHCP client (obtain automatically). I  suggest the latter option, since if you enter the IP address info  manually, you&#8217;ll need to include the Gateway and DNS information, which  you might have trouble figuring out.<\/p>\n<h3>Two Problems<\/h3>\n<p>Our two-router setup doesn&#8217;t cause problems with simple Internet use  including email, web browsing, instant messaging, and most applications,  i.e. <strong>anything where you initiate the request for data<\/strong>. But you&#8217;ll run into two problems when you try to get file and <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">printer<\/a> sharing going, which I&#8217;ll now explain.<\/p>\n<p>Problem 1 is that the multiple subnets in our example LAN cause <strong>problems with network browsing<\/strong>. This means when you use <strong>My Network Places<\/strong> in Win2000 and XP or <strong>Network Neighborhood<\/strong> in earlier versions of Windows, the only <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computers<\/a> you&#8217;ll see are those connected to the <strong>same router<\/strong>. This problem can be solved by using a <a href=\"http:\/\/searchwin2000.techtarget.com\/sDefinition\/0,,sid1_gci214128,00.html\" target=\"_blank\"><strong>WINS<\/strong><\/a> server, but there are simpler fixes that I&#8217;ll describe in the next section.<\/p>\n<p>Problem 2 is caused by each <a id=\"itxthook3\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">router&#8217;s<\/a> firewall. By default, consumer routers block all unrequested data that  tries to travel from WAN port (the Internet) to LAN clients, and passes  all <strong>outbound<\/strong> data from LAN clients to WAN. The blocking of  inbound data requests provides the basic &#8220;firewalling&#8221; function of a NAT  router and keeps computers connected to the router&#8217;s LAN ports  inaccessible from the Internet. But this inbound filter gets in the way  of Microsoft File and Printer sharing when routers are connected  together.<\/p>\n<p>Referring to our example LAN in <strong><a href=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/howto\/two_routers.jpg\" target=\"_blank\">Figure 1<\/a><\/strong>,  this means wireless router clients will be able to file and printer  share with clients of the wired router, but not vice-versa.<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/attentionsml.gif\" border=\"0\" alt=\"NOTE!\" width=\"30\" height=\"30\" \/><strong>NOTE:<\/strong> This same &#8220;one-way&#8221; action will also complicate access to servers or  server-type applications running on any computers connected to the  second router. A simple fix for this problem is to connect those  computers to the first router, but the file and printer sharing  work-arounds shown later can also be used.<\/p>\n<h3>Solution 1 &#8211; Disable the second router<\/h3>\n<p>The easiest way around this whole problem is to not use the second router as a router! After all, it&#8217;s the NAT <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">firewall<\/a> that&#8217;s causing these hassles, and if you don&#8217;t need it, don&#8217;t use it!<\/p>\n<p>The only times you really need the second router to act as a router are:<\/p>\n<ul>\n<li>If you intentionally want to create a protected part of your LAN via the second router&#8217;s firewall<\/li>\n<li>You want to combine the firewall features of both <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">routers<\/a>, i.e. port filtering, content filtering, logging, etc.<\/li>\n<\/ul>\n<p>If you&#8217;re not trying to accomplish either of the above, then you&#8217;re better off disabling the second router. Here&#8217;s how:<\/p>\n<blockquote><p><strong>1)<\/strong> Choose a LAN <a id=\"itxthook3\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computer<\/a> <strong>on the second router<\/strong> and statically set its IP address information to their current values (use the <strong>Support<\/strong> tab of the Local area Connection Status window on WinXP and 2000, and <strong>Start &gt; Run &gt; winipcfg<\/strong> on Win95 and 98 systems to grab the current IP address info). This will  keep the computer that you&#8217;ll be using for the next steps from losing  its IP address info and the ability to connect to the routers.<\/p>\n<blockquote><p><strong>NOTE:<\/strong> Ignore this step if the computer you choose already has  static IP information, and remember to change back to &#8220;Obtain an IP  address automatically&#8221; if you weren&#8217;t using a static IP setup.<\/p><\/blockquote>\n<p><strong>2) Turn off the DHCP server in the second router.<\/strong> The first router also has a DHCP server, and you don&#8217;t want the two to conflict when you connect them.<\/p>\n<p><strong>3) Change the address of the second router<\/strong> so that it&#8217;s in the <strong>same subnet<\/strong> as the first router <strong>and<\/strong> doesn&#8217;t conflict with the first router&#8217;s base IP address or DHCP server  range. This will ensure that you can reach the admin server of the  second router from any LAN machine.<\/p>\n<blockquote><p>For our example setup, the first router base address is 192.168.1.1  with DHCP server range of 192.168.1.100 to 192.168.1.150. So set the  second router base address to any IP address between 192.168.1.151 to  192.168.1.254<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/attentionsml.gif\" border=\"0\" alt=\"NOTE!\" width=\"30\" height=\"30\" \/><strong>NOTE:<\/strong> Once you make this change, the computer you&#8217;re using will no longer be  able to communicate with either router because it is set to an IP  address in the subnet you just got rid of. So go back into the  computer&#8217;s TCP\/IP properties and change it back to &#8220;Obtain an IP address  automatically&#8221; (and do a DHCP release \/ renew) or set its IP address  info statically.<\/p>\n<p><strong>4)<\/strong> Once you take care of the items above, connect a <strong>LAN uplink port on one router and a LAN normal port on the other<\/strong>. It doesn&#8217;t matter which you use on which router, but <strong>don&#8217;t use the Uplink ports on both routers!<\/strong> If neither router has an uplink port, just use a crossover cable to  connect any LAN port on one box to any LAN port on the other. <strong>Figure 2<\/strong> shows an example of the two interconnection schemes when one router has an uplink port.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/howto\/two_router_intercon.jpg\" border=\"0\" alt=\"Router interconnection\" width=\"374\" height=\"203\" \/><\/p>\n<h6><strong>Figure 2: Router interconnection<\/strong><\/h6>\n<p>Note that since you&#8217;re no longer using the routing part of the second  router, none of the WAN (or Internet) setup parameters matter. You can  just leave them as they are&#8230; they won&#8217;t affect anything.<\/p><\/blockquote>\n<p>Congratulations! You&#8217;ve just turned that second router into a dumb  switch and\/or access point, and your sharing troubles are over!<\/p>\n<h3>Solution 2 &#8211; Sharing via IP address<\/h3>\n<p>If you really do need two routers, you&#8217;re going to have to live with  limitations on File and Printer sharing and Network Browsing. As  mentioned previously, <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computers<\/a> attached to each router will be able to browse and file and printer share with other clients attached to the <strong>same router<\/strong>. But only computers attached to the second <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">router<\/a> will be able to exchange files with computers attached to the first router, and <strong>the clients attached to the second router must initiate the file transfers<\/strong>.<\/p>\n<p>If you can live with this limitation, here&#8217;s how to access a remote shared folder or drive:<\/p>\n<blockquote><p><strong>1) Assign a static IP address<\/strong> to the computers that you want  to have access to. This is important since you&#8217;ll be accessing them by  IP address, not name, and if the remote <a id=\"itxthook3\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computer<\/a>(s) lease a different IP address at DHCP renewal time, you&#8217;ll have to track down and use their new address.<\/p><\/blockquote>\n<div>\n<p><strong>NOTE!<\/strong> Make sure you use static IP addresses outside the range  of the router&#8217;s DHCP server. For our example setup, the first router has  a DHCP server range of <strong>192.168.1.100 to 192.168.1.150<\/strong>. So be sure to assign static IPs from 192.168.1.151 to 192.168.1.254.<\/p>\n<\/div>\n<blockquote><p><strong>2)<\/strong> Open up a <strong>Run<\/strong> window (Start &gt; Run) and type in  followed by the <strong>IP address<\/strong> of the computer that you want to access. (I&#8217;m assuming that you&#8217;ve  already shared the desired drive or folder on that computer). <strong>Figure 3<\/strong> shows how it&#8217;s done for a computer with IP address 192.168.1.102.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/howto\/runbox.jpg\" border=\"0\" alt=\"Accessing a remote computer\" width=\"347\" height=\"163\" \/><\/p>\n<h6><strong>Figure 3: Accessing a remote computer<\/strong><\/h6>\n<blockquote><p>After a short wait, a window should open containing the shared drives and folders of the remote computer. <strong>Figure 4<\/strong> shows the shared items on the computer I reached at <strong>192.168.3.154<\/strong>.<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/howto\/shared_folders.jpg\" border=\"0\" alt=\"Shared items on 192.168.3.154\" width=\"215\" height=\"181\" \/><\/p>\n<h6><strong>Figure 4: Shared items on 192.168.3.154<\/strong><\/h6>\n<blockquote>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/tip_hp.gif\" border=\"0\" alt=\"Tip!\" width=\"16\" height=\"16\" \/> <strong>TIP:<\/strong> You can also use Windows&#8217; <strong>Find Computer<\/strong> function. Just omit the leading &#8220;&#8221; and type in only the IP address of the machine you&#8217;re looking for.<\/p><\/blockquote>\n<p><strong>3)<\/strong> To avoid having to go through all these hoops the next time  you want to access a remote shared file, just right-click on any of the  items shown in the window opened in Step 2, choose <strong>Create Shortcut<\/strong> or <strong>Map Network Drive<\/strong>. (If you&#8217;re using WinXP, you can find Map Network Drive in <strong>My Computer &gt; Tools<\/strong>).  Then all you&#8217;ll need to do the next time you want to access the shared  item is to double click on the shortcut or open the drive in My  Computer.<\/p><\/blockquote>\n<p>It&#8217;s also possible to use computer names instead of IP addresses to  find remote computers by editing the LMHOSTS file on specific computers.  But since this doesn&#8217;t get network browsing working and can be  difficult to maintain, I don&#8217;t recommend you mess with this.<\/p>\n<blockquote><p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.smallnetbuilder.com\/images_old\/myimages\/tip_hp.gif\" border=\"0\" alt=\"Tip!\" width=\"16\" height=\"16\" \/> <strong>TIP:<\/strong> If you want to know more about creating an LMHOSTS file, see the Microsoft article <strong><a href=\"http:\/\/www.microsoft.com\/technet\/archive\/ntwrkstn\/reskit\/lmhw.mspx?mfr=true\" target=\"_blank\">Windows NT Workstation Resource Kit &#8211; Using LMHOSTS Files<\/a><\/strong><\/p>\n<p><strong><br \/>\n<\/strong><\/p>\n<h3>Going the other way<\/h3>\n<p>My earlier statement that clients connected to the first router won&#8217;t  be able to access any clients attached to the second router for file  and printer sharing actually isn&#8217;t entirely true. By using the second  router&#8217;s DMZ (or exposed <a id=\"itxthook1\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">computer<\/a>) function you can actually share in this direction, but for <strong>only one second router client at a time<\/strong>.<\/p>\n<p>All you need to do is put the IP address of the computer you want to share in DMZ, then use the <strong>WAN IP address of the router<\/strong> when you go to access the computer. You don&#8217;t have to worry about  weakening security for the computer that you put in DMZ, since it&#8217;s  already protected by the first <a id=\"itxthook2\" rel=\"nofollow\" href=\"http:\/\/www.smallnetbuilder.com\/lanwan\/lanwan-howto\/24431-howtotworoutersharing#\">router&#8217;s<\/a> firewall. But if you&#8217;re really paranoid, you can open just <strong>TCP and UDP ports 137, 138, and 139<\/strong> to the IP address of the computer that you want to access <strong>instead<\/strong> of putting it in DMZ.<\/p>\n<p><strong><br \/>\n<\/strong><\/p><\/blockquote>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Introduction We often hear from people who have two (or more!) routers in their LAN and are trying to get Microsoft File and Printer sharing running among all their computers. This ProblemSolver will explain why this doesn&#8217;t work by default and provide some suggestions for working around the problem. Setting Up Figure 1 shows a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry","category-networking-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=193"}],"version-history":[{"count":3,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/193\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}