0

I have a network composed of 2 subnets with this topology :

Router1 (Freebox) : 192.168.0.XX  Masq : 255.255.255.0  
|  
|----- PC1  
|----- PC2  
|----- Printer1  
|  
|----- Router2 (wrt610N with dd-wrt configured in gateway mode) : 192.168.1.XX  Masq : 255.255.255.0  
        |  
        |---- PC3  
        |---- PC4  

Router1 is set in DHCP and takes its DNS from the internet provider. It also provides DHCP server, with static IP assignation for Printer1 and Router2 defined in Router1. Router2 is set in DHCP and takes its DNS from Router1 and provides DHCP server for PC3 and PC4.

The purpose is to have a router2 subnetwork be a secured network and invisible from the main network where untrusted PC will be connected.

I can print from PC1 and PC2 with thw IP or hostname of the printer. From PC3 and PC4 I can only reach the printer through its IP, I cannot resolve the name Printer1. From my understanding it is related to ARP tables (I'm not an expert at all in networking). Since Printer1 hostname is not registered in any DNS, its hostname is only resolve at layer 2. When I ping Printet1 hostname from PC3, I assumed that : 1- Printer2 not in PC3 arp table so it sends the resquest to router2 2- router2 have an interface in subnetwork1 so it should have an entry for Printer1 in it's ARP table. Where am I wrong ?

Thanks for your help.

user32210
  • 5
  • 1
  • 3

3 Answers3

1

It 's a problem of broadcasting domains, you need to create an entry for the printer in your hosts config file for the PC3/4 to resolve the printer adress. (or setup your own DNS server or ARP proxy which seems like overkill imho)

Maxwell
  • 5,026
  • 1
  • 25
  • 31
  • ok for the answer. I don't want to modify my hosts files because there is more PC on the subnetwork than I described. The others solutions seem effectively overkill. – user32210 Jan 19 '10 at 17:56
0

If you want hostnames to resolve to IP address then you either need to add them to DNS (effective for anyone using that DNS server) or to a machine's hosts file (effective for that machine only) or LMHOSTS file for Windows machines using NetBIOS. ARP is responsible for IP address to MAC address resolution, doesn't have anything to do with hostnames.

Simplest thing would be to just add the printer to the hosts/LMHOSTS file on PC3 and PC4. If you do this then you should also consider giving the printer a static IP address outside of the range of addresses your DHCP servers are handing out. That way you don't have to update your hosts files every time your printer is assigned a new IP address.

EDIT:
Have a look at this KB - Local NetBIOS Name Query Broadcast Not Forwarded by Router

squillman
  • 37,618
  • 10
  • 90
  • 145
  • Ok, but why "ping printer1" works from PC1 or PC2 ? printer1 is not registered in any DNS nor I add "printer1 192.168.1.XX" in PC1 or PC2 hosts file ? For the moment I use DHCP with a kind of "static" assignment : the router always assign the same IP to the printer. – user32210 Jan 19 '10 at 17:54
  • They're most likely getting the name resolution via NetBIOS. – squillman Jan 19 '10 at 18:12
  • I didn't block netbios so you are certainly right (PCs are under Ubuntu 9.10 with Samba enabled). How can I verify that ? Do you think it is possible to let the netbios traffic pass through router2 only one way? Is it recommended ? – user32210 Jan 19 '10 at 19:41
  • Edited with a link to a KB. – squillman Jan 19 '10 at 19:57
0

As Maxwell and squillman have pointed out, you have a name resolution problem. My question is: Why is it important to connect to the printer by name? Why not connect to it by ip address?

joeqwerty
  • 108,377
  • 6
  • 80
  • 171
  • it is not so important, I thought it was more elegant to connect by name in case I change the topology of the network I will not have to change the IP in each PC that use the printer. – user32210 Jan 19 '10 at 17:49
  • True, but you'll still need some way to manage name resolution across the subnets, so it's six of one and a half dozen of the other. – joeqwerty Jan 19 '10 at 17:52