Add VLAN hosts to Trellis P4 topology
Change-Id: Ica7f6fee6d33cbddfd4be82426c8f37d5ca7cda8
diff --git a/trellis/trellisp4.json b/trellis/trellisp4.json
index 9a7fcaf..608e033 100644
--- a/trellis/trellisp4.json
+++ b/trellis/trellisp4.json
@@ -14,7 +14,7 @@
{
"name": "h2",
"ips" : [ "10.0.2.254/24" ],
- "vlan-untagged": 10
+ "vlan-tagged": [10]
}
]
},
@@ -32,7 +32,7 @@
{
"name": "h4",
"ips" : [ "10.0.3.254/24" ],
- "vlan-untagged": 20
+ "vlan-tagged": [20]
}
]
}
diff --git a/trellis/trellisp4.py b/trellis/trellisp4.py
index 30db525..6522bd0 100755
--- a/trellis/trellisp4.py
+++ b/trellis/trellisp4.py
@@ -18,6 +18,7 @@
from mininet.log import setLogLevel
from mininet.node import Host, RemoteController
from routinglib import RoutedHost
+from trellislib import TaggedRoutedHost
from bmv2 import ONOSBmv2Switch
PIPECONF_ID = 'org.onosproject.pipelines.fabric'
@@ -46,9 +47,9 @@
# NOTE avoid using 00:00:00:00:00:xx which is the default mac of host behind upstream router
# IPv4 Hosts
h1 = self.addHost('h1', cls=RoutedHost, mac='00:aa:00:00:00:01', ips=['10.0.2.1/24'], gateway='10.0.2.254')
- h2 = self.addHost('h2', cls=RoutedHost, mac='00:aa:00:00:00:02', ips=['10.0.2.2/24'], gateway='10.0.2.254')
+ h2 = self.addHost('h2', cls=TaggedRoutedHost, mac='00:aa:00:00:00:02', ips=['10.0.2.2/24'], gateway='10.0.2.254', vlan=10)
h3 = self.addHost('h3', cls=RoutedHost, mac='00:aa:00:00:00:03', ips=['10.0.3.1/24'], gateway='10.0.3.254')
- h4 = self.addHost('h4', cls=RoutedHost, mac='00:aa:00:00:00:04', ips=['10.0.3.2/24'], gateway='10.0.3.254')
+ h4 = self.addHost('h4', cls=TaggedRoutedHost, mac='00:aa:00:00:00:04', ips=['10.0.3.2/24'], gateway='10.0.3.254', vlan=20)
self.addLink(h1, s204)
self.addLink(h2, s204)
self.addLink(h3, s205)