mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 19:38:57 +00:00
parent
68725778e8
commit
2b1fab6742
@ -49,7 +49,7 @@ class EthernetHub(Bridge):
|
||||
if ports is None:
|
||||
# create 8 ports by default
|
||||
self._ports = []
|
||||
for port_number in range(1, 9):
|
||||
for port_number in range(0, 8):
|
||||
self._ports.append({"port_number": port_number,
|
||||
"name": "Ethernet{}".format(port_number)})
|
||||
else:
|
||||
|
@ -52,7 +52,7 @@ class EthernetSwitch(Device):
|
||||
if ports is None:
|
||||
# create 8 ports by default
|
||||
self._ports = []
|
||||
for port_number in range(1, 9):
|
||||
for port_number in range(0, 8):
|
||||
self._ports.append({"port_number": port_number,
|
||||
"name": "Ethernet{}".format(port_number),
|
||||
"type": "access",
|
||||
|
@ -204,8 +204,8 @@ def _convert_1_3_later(topo, topo_path):
|
||||
node["properties"]["ports_mapping"] = []
|
||||
for port in old_node["ports"]:
|
||||
node["properties"]["ports_mapping"].append({
|
||||
"name": "Ethernet{}".format(port["port_number"]),
|
||||
"port_number": port["port_number"]
|
||||
"name": "Ethernet{}".format(port["port_number"] - 1),
|
||||
"port_number": port["port_number"] - 1
|
||||
})
|
||||
elif old_node["type"] == "EthernetSwitch":
|
||||
node["node_type"] = "ethernet_switch"
|
||||
@ -214,8 +214,8 @@ def _convert_1_3_later(topo, topo_path):
|
||||
node["properties"]["ports_mapping"] = []
|
||||
for port in old_node["ports"]:
|
||||
node["properties"]["ports_mapping"].append({
|
||||
"name": "Ethernet{}".format(port["port_number"]),
|
||||
"port_number": port["port_number"],
|
||||
"name": "Ethernet{}".format(port["port_number"] - 1),
|
||||
"port_number": port["port_number"] - 1,
|
||||
"type": port["type"],
|
||||
"vlan": port["vlan"]
|
||||
})
|
||||
|
@ -62,6 +62,10 @@
|
||||
"first_port_name": null,
|
||||
"properties": {
|
||||
"ports_mapping": [
|
||||
{
|
||||
"name": "Ethernet0",
|
||||
"port_number": 0
|
||||
},
|
||||
{
|
||||
"name": "Ethernet1",
|
||||
"port_number": 1
|
||||
@ -89,10 +93,6 @@
|
||||
{
|
||||
"name": "Ethernet7",
|
||||
"port_number": 7
|
||||
},
|
||||
{
|
||||
"name": "Ethernet8",
|
||||
"port_number": 8
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -120,6 +120,12 @@
|
||||
"first_port_name": null,
|
||||
"properties": {
|
||||
"ports_mapping": [
|
||||
{
|
||||
"name": "Ethernet0",
|
||||
"port_number": 0,
|
||||
"type": "access",
|
||||
"vlan": 1
|
||||
},
|
||||
{
|
||||
"name": "Ethernet1",
|
||||
"port_number": 1,
|
||||
@ -161,12 +167,6 @@
|
||||
"port_number": 7,
|
||||
"type": "access",
|
||||
"vlan": 1
|
||||
},
|
||||
{
|
||||
"name": "Ethernet8",
|
||||
"port_number": 8,
|
||||
"type": "access",
|
||||
"vlan": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user