Skip to content

Commit

Permalink
Remove IOL MAC generation (#2262)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelemc authored Oct 27, 2024
1 parent 5948957 commit 17b295e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions nodes/iol/iol.cfg.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ interface Ethernet0/0
ip address {{ .MgmtIPv4Addr }} {{ .MgmtIPv4SubnetMask }}
ipv6 address {{ .MgmtIPv6Addr }}/{{ .MgmtIPv6PrefixLen }}
no shutdown
mac-address {{ .MgmtIntfMacAddr }}
!{{ range $index, $item := .DataIFaces }}
interface Ethernet{{ .Slot }}/{{ .Port }}
no shutdown
mac-address {{ .MacAddr }}
!{{ end }}
ip forward-protocol nd
!
Expand Down
11 changes: 0 additions & 11 deletions nodes/iol/iol.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ var (
IOLCfgTpl, _ = template.New("clab-iol-default-config").Funcs(
gomplate.CreateFuncs(context.Background(), new(data.Data))).Parse(cfgTemplate)

IOLMACBase = "00:00:5E"

InterfaceRegexp = regexp.MustCompile(`(?:e|Ethernet)\s?(?P<slot>\d+)/(?P<port>\d+)$`)
InterfaceOffset = 1
InterfaceHelp = "eX/Y or EthernetX/Y (where X >= 0 and Y >= 1)"
Expand Down Expand Up @@ -178,8 +176,6 @@ func (n *iol) GenInterfaceConfig(_ context.Context) error {
slot = x / 4
port = x % 4

hwa, _ := utils.GenMac(IOLMACBase)

// append data to write to NETMAP and IOUYAP files
iouyapData += fmt.Sprintf("[513:%d/%d]\neth_dev = %s\n", slot, port, intf.GetIfaceName())
netmapdata += fmt.Sprintf("%s:%d/%d 513:%d/%d\n", n.Pid, slot, port, slot, port)
Expand All @@ -191,7 +187,6 @@ func (n *iol) GenInterfaceConfig(_ context.Context) error {
x,
slot,
port,
hwa.String(),
},
)

Expand All @@ -201,9 +196,6 @@ func (n *iol) GenInterfaceConfig(_ context.Context) error {
utils.CreateFile(path.Join(n.Cfg.LabDir, "iouyap.ini"), iouyapData)
utils.CreateFile(path.Join(n.Cfg.LabDir, "NETMAP"), netmapdata)

// generate mgmt MAC, it shouldn't be the same as the linux container
hwa, _ := utils.GenMac(IOLMACBase)

// create startup config template
tpl := IOLTemplateData{
Hostname: n.Cfg.ShortName,
Expand All @@ -214,7 +206,6 @@ func (n *iol) GenInterfaceConfig(_ context.Context) error {
MgmtIPv6Addr: n.Cfg.MgmtIPv6Address,
MgmtIPv6PrefixLen: n.Cfg.MgmtIPv6PrefixLength,
MgmtIPv6GW: n.Cfg.MgmtIPv6Gateway,
MgmtIntfMacAddr: hwa.String(),
DataIFaces: IOLInterfaces,
}

Expand All @@ -239,7 +230,6 @@ type IOLTemplateData struct {
MgmtIPv6Addr string
MgmtIPv6PrefixLen int
MgmtIPv6GW string
MgmtIntfMacAddr string
DataIFaces []IOLInterface
}

Expand All @@ -250,7 +240,6 @@ type IOLInterface struct {
IfaceIdx int
Slot int
Port int
MacAddr string
}

func (n *iol) GetMappedInterfaceName(ifName string) (string, error) {
Expand Down

0 comments on commit 17b295e

Please sign in to comment.