Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Question: is it possible for a router to connect to one switch both from one of its LAN ports and from its WAN port, and for a device connected to the switch get both public and private (provided by the router) IP addresses?

enter image description here

Context: Each room in my house has one ethernet port. All the ports are connected to a switch in the smart box, where it connects to the WAN port. I have four devices that need wired connection in three rooms. Two of those need public IP addresses, and three of those must be in the same private network.

  • Room 1: TV (public), printer (private)
  • Room 2: PC (private)
  • Room 3: server (both public and private)

Below is the network map illustrating the configuration:

enter image description here

I have one router and one switch for now, and am thinking of buying two more switches if they are necessary.

P.S. I'm not a native speaker of English, so feel free to edit this question if there are typos, grammatical errors, or any nonsenses.

share|improve this question

closed as off topic by EEAA, Ward, Michael Hampton, HopelessN00b, John Gardeniers Oct 10 '12 at 11:17

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

It's possible to do, but why would you want to? What do you want the public addressing to do for your TV and server? Why couldn't existing NAT mechanisms help with that? – B Knight Jan 17 '12 at 14:40
up vote 1 down vote accepted

Yes it is possible, but you need switches and routers with support for VLAN tagging (802.1Q), otherwise all your devices will be in single broadcast domain (will see all traffic, both public and private).

Regular switches don't have this feature, you need managed ones. As for routers: alternative firmwares (like Tomato or DD-WRT) for SOHO routers support this.

share|improve this answer
You can do it in a single broadcast domain. By "private", he means unroutable, RFC1918 IP addresses, not that it needs to be firewalled. NAT on a stick works fine if you just want to make things work. – David Schwartz Jan 1 '12 at 16:17

It depends on how public addresses are provisioned, and whether your ISP will allow you multiple IP addresses. For example, with PPPoE/A (xDSL) the addresses are provisioned over Ethernet, therefore it is possible to run the client on nodes that require a public address. Each node with a public address will require its own firewall in order to block incoming connections.

If you are using protocols that have a different provisioning mechanism (e.g. DOCSIS) then the router will have to handle all the public addresses, putting each node into the DMZ with the appropriate address. Note that this requires a router that can handle provisioning multiple addresses.

And of course, if your ISP only allows you a single IP address then you're SOL regardless.

share|improve this answer
My ISP allows at least up to three IP addresses. As far as I know, addresses are provisioned via DHCP. – C. Lee Jan 1 '12 at 13:27
Yeah, DHCP is bad, since you can only properly have one DHCP server per network segment. Normally the router separates the WAN segment from the LAN segment, but your diagram has no such segmentation. – Ignacio Vazquez-Abrams Jan 1 '12 at 13:30
What happens if I turn off the DHCP server on the router and manually set private address (like 192.168.0.x) and gateway (to the router's public address) on PC in that configuration? – C. Lee Jan 1 '12 at 13:36

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