4

I have the following abridged configuration for a Ubiquiti switch:

interfaces {
    ethernet eth1 {
        address 192.168.4.1/24
        vif 101 {
            address 10.10.254.1/24
        }
        vif 103 {
            address 10.1.1.1/24
        }
    }
}
protocols {
    static {
        route 10.1.1.0/24 {
            next-hop 192.168.4.254 {
            }
        }
        route 10.10.254.0/24 {
            next-hop 192.168.4.254 {
            }
        }
    }
}

where 192.168.4.254 is the Gateway and the vifs share the exact same firewall configuration with eth1.

Devices on eth1's network can see devices on vif101 when they are configured to talk to the gateway for the vifs subnets through the following route entries:

10.1.1/24          192.168.4.254      UGSc            1        2     en5
10.10.254/24       192.168.4.254      UGSc            0        0     en5

However, the switch cannot reach devices on either vif and devices on the vifs cannot reach the Internet despite being able to reach the gateway and devices on eth1 even with the static routing. Devices on eth1 are able to communicate with the Internet.

The routing table on the switch is:

S>* 0.0.0.0/0 [1/0] via --redacted--, eth0
S   10.1.1.0/24 [1/0] via 192.168.4.254
C>* 10.1.1.0/24 is directly connected, eth1.103
S   10.10.254.0/24 [1/0] via 192.168.4.254
C>* 10.10.254.0/24 is directly connected, eth1.101
C>* --redacted-- is directly connected, eth0
C>* 127.0.0.0/8 is directly connected, lo
C>* 192.168.4.0/24 is directly connected, eth1

The routing table on one of the devices on vif101 is:

  Destination           Gateway           Flags  Ref     Use     Interface 
-------------------- -------------------- ----- ----- ---------- --------- 
default              10.1.1.1             UG        4       1954 net0      
10.0.1.0             10.0.1.38            U         4        958 net1      
10.1.1.0             10.1.1.7             U         3          1 net0      
127.0.0.1            127.0.0.1            UH        2          0 lo0    

I don't have networking knowledge so I'm not sure if there's something obvious I'm missing. How do I get the vifs to communicate with the Internet?

6
  • I am a bit confused about which switch I'm looking at in your screen shots. One switch? Multiple switches? However, concerning the static default route of "0.0.0.0/0 [1/0] via 72.143.127.169, eth0".... is 72.143.127.169 on the other end of eth0 ? If so, is eth0 in the same subnet as 72.143.127.169? On which switch is the default gateway of 192.168.4.254 set?
    – NetRay
    Nov 4, 2015 at 5:32
  • 5
    Why do you have static routes configured for networks which are directly connected?
    – Teun Vink
    Nov 4, 2015 at 6:27
  • 1
    @NetRay, the configuration is from one switch. There are two others on the network but I'm not sure how to get at their configuration (just inherited the setup). eth0 is in the same subnet. There's a system section further down in the file containing gateway-address with a setting of 72.143.127.169. Nothing has 192.168.4.254 set as the default gateway though maybe that's worth trying. Nov 4, 2015 at 14:56
  • 1
    @TeunVink, I have static routes configured for those networks because those vlans become reachable when I do that for devices on eth1 so I assumed the same would be true for the switch. For whatever reason, I can't seem to reach devices on the vlans from the switch even with the direct connection. Nov 4, 2015 at 14:58
  • You could improve your question by editing it to add more details. You may find our Question Checklist helpful when editing your question. For example: model numbers of the switch (Ubiquiti has at least three different switch products that I am aware of with somewhat different management) and a network diagram may help.
    – YLearn
    Nov 5, 2015 at 5:28

4 Answers 4

1

I don't have much experience with ubiquiti switches but normally you wouldn't add static routes for networks that are directly connected interfaces. What I think you are looking for is a default route that will send all traffic to a router that is connected to the internet.

I tried looking for a configuration example but couldn't find one. Basically, you would create a static route for 0.0.0.0/0 and point that to 192.168.4.254. From the routing table you provided, it looks like the 0.0.0.0/0 route is being sent out eth1 and that may not be correct.

0.0.0.0/0 -> 192.168.4.254

The 192.168.4.254 device will then need static routes back to your switch with a configuration like this:

10.10.254.0/24 -> 192.168.4.1
10.1.1.0/24 ->192.168.4.1

Let me know if that works!

Josh

0

I am not able to understand any of the config, which commands are these?

I can tell you about vlans and routing them to the internet.

  1. Create vlans.
  2. Terminate the vlans. This can be a L3 switch where the vlan gateway is an virtual vlan interface on the switch itself or subinterfaces on a router.
  3. The router between your vlans and the internet should have a static route back to each of your vlans. Because the router can't see of your vlans and doesn't know those networks and hence can't send back the reply packets to them.

Use this and this for better understanding.

3
  • 1
    The linked documents are for low end Cisco switches, the poster specifically mentioned he's using Ubiquiti.
    – Teun Vink
    Nov 4, 2015 at 6:24
  • @allwynmasc, in response to your question "I am not able to understand any of the config, which commands are these?", the first line in the OPs post states that they're using a Ubiquiti switch :)
    – OzNetNerd
    Nov 4, 2015 at 22:24
  • @OzNetNerd totally missed it, thanks. i linked those to give him an idea of how vlans work in general like i said.
    – allwynmasc
    Nov 5, 2015 at 15:03
0

Do you have routes in 192.168.4.254 that point back to the addresses in the switch?

You need to point 10.10.254.0/24 to 10.10.254.1 and 10.1.1.0/24 to 10.1.1.1 inside 192.168.4.254.

0

Please know that vif1 at 103 at 10.1.1.0 will not able to communicate, as you have conflicting routing statements:

S 10.1.1.0/24 [1/0] via 192.168.4.254

C>* 10.1.1.0/24 is directly connected, eth1.103

These statements, will cause the packet to never leave the router: Packet sourced from 10.1.1.50 (Random host) sends traffic across LAN, the traffic hits gateway at 10.1.1.1 (router) the router looks at the routing table, the static route to 192.168.4.254 has an AD of 1 (Very reliable), however the connected route on eth1.103 has an AD of 0 (Best, indicated by the "*"). By this reason the router will forward the traffic back through the eth1.103

Same with the 10.10.254.0 respectively to its network

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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