示例#1
0
func enableDoLinkLocal() {
	err := rancherNetwork.ApplyNetworkConfigs(&rancherConfig.NetworkConfig{
		Interfaces: map[string]rancherConfig.InterfaceConfig{
			"eth0": {
				IPV4LL: true,
			},
		},
	})
	if err != nil {
		log.Errorf("Failed to apply link local on eth0: %v", err)
	}
}
示例#2
0
文件: init.go 项目: beibei1990/os
func setupSystemBridge(cfg *config.Config) error {
	bridge, cidr := cfg.SystemDocker.BridgeConfig()
	if bridge == "" {
		return nil
	}

	return network.ApplyNetworkConfigs(&config.NetworkConfig{
		Interfaces: map[string]config.InterfaceConfig{
			bridge: {
				Bridge:  true,
				Address: cidr,
			},
		},
	})
}