Using the Juniper EX3300 Switch as a router?

I have a Juniper EX3300 switch in a data center. And I have connected one of the uplink ports (ge-0/1/0) to my ISP's router. I want to configure it so that all the devices connected to ports in the same VLAN as ge-0/1/0 can access the Internet. I have done some research, and I haven't gotten anywhere really.

I have configured the interface as follows:

ge-0/1/0 {
    ether-options {                 
        no-auto-negotiation;
        link-mode full-duplex;
        speed {
            1g;
        }
    }
    unit 0 {
        family inet {
            address xx.xx.xx.xx/32;
        }
    }
}

where xx.xx.xx.xx is the "Customer Router Port IP" assigned by my ISP.

When I try to commit, I get the following error:

Interface ge-0/1/0.0 not enabled for switching

Can some one tell me what is the right way to configure it?


Solution 1:

It is unclear whether you want topology A or B below (I think you need B, but your question seems to ask for A)

          Vlan10           Vlan10
A) [Users]----------[EX330]----------[ISP]
                   x.x.x.x/zz

          Vlan10           Vlan11
B) [Users]----------[EX330]---------------------------[ISP]
              y.y.y.y/24  xx.xx.xx.109/30     .110/30

A)
This is a flat layer2 vlan, and all your computers must be addressed on a subnet from the ISP. Vlan-10 is used for all your machines and they set their default-gateway to x.x.x.x.

I'm not sure why you're using a /32 mask in your question. It's unlikely that you want to do this, since it means you proxy-arp for all destinations. Work with your provider to understand what your actual netmask should be (I'm assuming zz, below)

delete interfaces ge-0/1/0 unit 0
delete interfaces ge-0/1/0
delete interfaces ge-0/1/1 unit 0
delete interfaces ge-0/1/1
set vlans vlan-10 vlan-id 10
set vlans vlan-10 interface ge-0/1/0
set vlans vlan-10 interface ge-0/1/1
set interfaces ge-0/1/0 unit 0 family ethernet-switching port-mode access
set interfaces ge-0/1/1 unit 0 family ethernet-switching port-mode access
set interfaces vlan unit 10 family inet address x.x.x.x/zz
set routing-options static route 0.0.0.0/0 next-hop xx.xx.xx.110

B)
This involves two different vlans: 10 and 11. Vlan-10 is used for all your servers and they set their default-gateway to y.y.y.y.

delete interfaces ge-0/1/0 unit 0
delete interfaces ge-0/1/0
delete interfaces ge-0/1/1 unit 0
delete interfaces ge-0/1/1
set vlans vlan-10 vlan-id 10
set vlans vlan-11 vlan-id 11
set vlans vlan-10 interface ge-0/1/0
set vlans vlan-11 interface ge-0/1/1
set interfaces ge-0/1/0 unit 0 family ethernet-switching port-mode access
set interfaces ge-0/1/1 unit 0 family ethernet-switching port-mode access
set interfaces vlan unit 11 family inet address xx.xx.xx.109/30
set interfaces vlan unit 10 family inet address y.y.y.y/zz
set routing-options static route 0.0.0.0/0 next-hop xx.xx.xx.110

Add as many ports as you need for servers in Vlan-11. Solution B must use some form of NAT if you don't have enough public address space from your provider to include both subnets for Vlan10 and Vlan11