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

Possible Duplicate:
Using the Juniper EX3300 Switch as a router?

So I have a Juniper EX3300 Switch. One of its uplink ports (ge-0/1/0) is connected to my ISP's router. ISP router's port address is xx.xx.xx.109. My switch's IP address is xx.xx.xx.110.

From the switch, I can ping to xx.xx.xx.109 and any other IP in the world. I mean its connected to the Internet.

I connected the port eth0 of a computer (running Ubuntu) to the port ge-0/0/0 of the switch (which in the same VLAN as ge-0/1/0). I configured the port eth0 as follows:

iface eth0 inet static
    address yy.yy.yy.208
    gateway xx.xx.xx.110

yy.yy.yy.208 is assigned to me by the ISP. So, now I can ping to the switch (xx.xx.xx.110) from this computer. But I can not ping to either xx.xx.xx.109 (ISP router) or any other IP.

I want this computer to be connected to the Internet. What am I doing wrong?

Here are some of the configurations on my switch:

interfaces {
    ge-0/0/0 {
        unit 0 {
            family ethernet-switching;
    ge-0/1/0 {
        ether-options {
            link-mode full-duplex;
            speed {
        unit 0 {
            family ethernet-switching {
                port-mode access;
    vlan {
        unit 0 {
            family inet {
        unit 1 {
            family inet {
                address xx.xx.xx.110/30;
routing-options {
    static {
        route {
            next-hop xx.xx.xx.109;
vlans {
    Cogent {
        vlan-id 3;
        interface {
        l3-interface vlan.1;
    TFLan {
        vlan-id 2;
        interface {
        l3-interface vlan.0;
share|improve this question

marked as duplicate by SpacemanSpiff, Bart De Vos, Iain Aug 13 '12 at 17:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Stop reposting your question please. You cannot use the EX3300 as a NAT router, stop trying. – SpacemanSpiff Jun 23 '12 at 22:40
@SpacemanSpiff, look carefully... the problem is not NAT for this particular issue – Mike Pennington Jun 23 '12 at 23:26
There needs to be someone in your organization who understands IP networking. Really, there's no way around this requirement. (The most obvious problem -- how is that computer supposed to reach its gateway since its gateway is outside its subnet? It would need a gateway to reach the gateway!) – David Schwartz Jun 24 '12 at 0:08
@MikePennington - even if he fixes the glaring subnetting issue, it's still not going to magically NAT – SpacemanSpiff Jun 24 '12 at 2:44
@SpacemanSpiff, subnet is assigned to l3-interface vlan.0. His Ubuntu machine is on vlan.1 (I know this because he said it's on ge-0/0/0). He put two different subnets (a /30 and /28) in the same vlan – Mike Pennington Jun 24 '12 at 2:48
up vote 3 down vote accepted

I want this computer to be connected to the internet. What am I doing wrong?

Summary info

Recalling information from the discussion in Using the Juniper EX3300 as a router:

  • ge-0/1/0 is assigned a public /30 address by Cogent. For sake of illustration, we will call EX3300's address on this subnet Your default gateway is From the configuration above, you have assigned ge-0/1/0 to vlan.1 using vlan-id 3.
  • ge-0/0/0 is also assigned a public IP address. For the sake of argument, this subnet is ge-0/0/0's subnet is different than ge-0/1/0. The interface addressing (and a few other things) need to be fixed.

List of items to fix

  1. You can't assign to the Ubuntu server. .208 is the subnet adddress, and .223 is the broadcast address. Valid host addresses in this subnet range from to (it doesn't matter that I'm using RFC 5737 addresses here, the subnet math works out the same).
  2. You need l3-interface vlan.1 for your /30 link to the Cogent router; however, you also have the Ubuntu machine in that same subnet on a /28. Now that we have established that the Ubuntu server is in a different subnet than ge-0/1/0, please follow standard internet engineering practices and assign a different vlan to that subnet. Let's call it l3 interface vlan.100 with vlan-id 100 on your EX3300. Assign to your vlan.100 on the EX3300 and use it as the default gateway for this new subnet.
  3. Even if you assigned a valid host address to your Ubuntu server (see point 1., above), that server's default gateway must be in the same subnet. Assign to the Ubuntu server and make the default gateway

Purely informational material

FYI, We also said that you cannot use private IP addresses (RFC 1918) without NAT (RFC 3022). I see that you have assigned to vlan.0. Anything in is RFC 1918 space. If these devices need to access the internet, you will need some form of NAT.

May I suggest:

Best of luck to you in this endeavor.

share|improve this answer
I don't need the devices to access Internet. OK, I did exactly what u said. I created a new VLAN (4) and assigned it xx.xx.xx.209/28. I assigned the ubuntu server xx.xx.xx.210/28 and gateway xx.xx.xx.209. Now I can ping the xx.xx.xx.209 (of course) AND xx.xx.xx.110 (the address of VLAN 3). But I still can't get any further than that – Richard Whitman Jun 24 '12 at 3:00
By the way the Cogent router IP is totally different from my assigned IP range. I dont know how to say it, but only the first part of both of them is same. i.e. they both start with 38. but everything is different after that – Richard Whitman Jun 24 '12 at 3:04
Have you verified that Cogent is pointing the next-hop for their /28 routes to (you will need to replace my example address w/ the real address). Also, can you still ping your default gateway to Cogent from the EX3300? (I'm calling the Cogent gw – Mike Pennington Jun 24 '12 at 3:06
Yes I can ping the cogent gateway from my switch. but not from the ubuntu server. – Richard Whitman Jun 24 '12 at 3:14
If Ubuntu can ping and Cogent cannot ping, then it sounds like Cogent hasn't got their /28 pointed at – Mike Pennington Jun 24 '12 at 3:16

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