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

I currently have a router (Netgear WNDR3700 with DD-WRT; let's say its hostname is host1) and all the devices are behind its NAT.

        host1      (dmz)
       /    |
      /     |   
    [pc]  [laptop]

My ISP is setting static IP addresses with dynamic DHCP and it's determining which IP address should I get by the hostname.

The first static IP is assigned to the host1 hostname and I've set the 'host1' hostname to my router.

I've got a second IP address and my ISP has set it to the host2.

How do I assign the second IP to any of my machines (including the router) without buying a switch and making this kind of network?:

       |      \
       host2   \
     [server]   \
               /     \
              /       \
            [pc]   [laptop]

Is there any way to setup my router OR the server (it has two Ethernet ports) that way with using one WAN ethernet cable from ISP, two hostnames that are sent by DHCP client and, therefore, two IPs?

Since my server has two Ethernet ports, the network below seems to be an adequate choice:

        \                            /———[pc]
        eth0                 host1  /
          \      eth1———————<router>
         host2  /                \
         <server>                 \———[laptop]


           host1             host2
           /   \
    +––––/  NAT  \–––––+
    |   /         \    |
    | [pc]    [laptop] |
    |                  |
    |     (wi-fi)      |
    |                  |


           host1            +––host2 nat––+
           host2            | (dmz)       |
          <router>–––––––––––[server]     |
          /       \         |             |
    +––––/host1 nat\–––+    +–––––––––––––+
    |   /           \  |
    | [pc]   [laptop]  |
    |                  |
    |     (wi-fi)      |
    |                  |

but how do I do it? Could anybody please give me a right direction to figuring it out myself? Network bridging? DHCP pass-through? What should I be looking for? Is there any better choices? (I'd rather stick with router right after WAN).

I'm quite lost.

share|improve this question

closed as off topic by HopelessN00b, Ward, mdpc, gravyface, Scott Pack Dec 10 '12 at 18:54

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.

up vote 1 down vote accepted

Broadcom: On Broadcom devices like the Linksys WRT54GL, what you want to do is put your server on the WAN side of the router. Your router has one WAN port and four LAN ports. But what makes them LAN vs WAN is really just a VLAN.

In DD-WRT go to Setup->VLANs. You should see the WAN port is assigned to a VLAN, probably VLAN1, and the LAN ports are assigned to another VLAN, probably VLAN0. Try changing one of the LAN ports to the WAN VLAN.

If that doesn't work, you might have to run the commands manually, under Administration->Commands.

Non-Broadcom: On non-Broadcom devices like the Netgear WNDR3700 you cannot easily do the required VLAN setup with DD-WRT. OpenWRT might allow you to manually create the required interfaces and VLANs. Documentation for the WNDR3700 is here.

Buy a Switch: The easiest thing to do is buy a cheap little switch and connect it to the WAN ports. Connect your server to the switch. Then your server will be able to connect directly to your ISP to get DHCP information.

share|improve this answer
Uh.. Sorry, but I'm not sure how setupping the second WAN port will help me with that problem. I have only one ISP's cable (which I plug either to server or router), what will I be able to achieve with making a second WAN on the router? – Igor Hatarist Dec 9 '12 at 10:42
@IOXenus: VLANs are like virtual switches. You plug your server into the second WAN port, it will be as if the server is on the WAN side of the firewall and can get an IP directly from your ISP. Basically your second diagram without the need for a switch. – Anton Cohen Dec 9 '12 at 10:57
Now I get it! Thanks a lot! – Igor Hatarist Dec 9 '12 at 11:15
Just to clarify - how will the second WAN port know that it needs to connect through the first WAN port directly? – Igor Hatarist Dec 9 '12 at 11:18
@IOXenus The physical ports on home routers are not usually like normal router or computer ports. They are more like a Layer 3 switch. Every port is part of the switch, and can be assigned to VLANs. Internally the router as interfaces (like eth0, eth1), but they are not bound to physical ports, they are assigned to VLANs. Logically, think of it as a switch. Imagine the router part of it being a separate machine with two interfaces. The switch is divided into two VLANs. Each port of router goes to a different VLAN, there is a LAN network and a WAN network, the router routes between them. – Anton Cohen Dec 9 '12 at 12:10

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