title: How to forward packets between VLANs on Open vSwitch router?
body: <p>I'm trying to configure an OVS router. I want to achieve that, by adding flows on the OVS router, the devices connected with switch ports (port 2-5) can access to the internet, if the internet cable is inserted into the WAN port (port 1).</p>
  
  <p>My VLAN configuration in file <code>/etc/config/network</code> of the OVS router is: </p>
  
  <pre><code>eth1.1: 0t, 2
  eth1.2: 0t, 3
  eth1.3: 0t, 4
  eth1.4: 0t, 5
  eth1.5: 1, 6
  </code></pre>
  
  <p>The output of <code>ovs-vsctl show</code> is:</p>
  
  <pre><code>root@OpenWrt:~# ovs-vsctl show
  84d9ab2f-a3e6-46e3-874f-156ef975d673
  Bridge "br0"
      Controller "tcp:&lt;an IP address&gt;"
          is_connected: true
      fail_mode: standalone
      Port "eth1.4"
          Interface "eth1.4"
      Port "eth1.2"
          Interface "eth1.2"
      Port "eth1.1"
          Interface "eth1.1"
      Port "br0"
          Interface "br0"
              type: internal
      Port "eth1.3"
          Interface "eth1.3"
  </code></pre>
  
  <p>The truncated output of <code>ifconfig</code> is:</p>
  
  <pre><code>br0: 192.168.3.1 
  eth0: 192.168.0.105 (There is another home router)
  eth1, eth1.1-1.4
  </code></pre>
  
  <p>As the subnet provides IP prefix of 192.168.3.* and the router itself is assigned IP of 192.168.0.<em>, I wonder if it's helpful to add a flow to forward packets from 192.168.3.</em> to 192.168.0.104.</p>
  
  <p>So is it correct if I suppose, a machine with IP 192.168.3.10, for example, it wants to make query to google, the path should be 192.168.3.10->192.168.0.105->192.168.0.1(home router)->outside?</p>
  
  <p>This is to build a flow based on Layer3. But I'm wondering if I can build flows between VLANs? According to my configuration, WAN port is port1, belongs to VLAN 5. Do you think is viable to add flows bidirectionally from VLAN 1 (machine connected) to VLAN 5 and from VLAN 5 to VLAN 1? If so, is there any examples I can flow please? </p>
  
  <p>Another detail. The output of <code>ifconfig</code> shows eth0 interface was assigned IP 192.168.0.105, which means it's connected with my home router (192.168.0.1). So do I need to forward packets between these to IP addresses?</p>
  
  <p>I really appreciate any help.</p>