Пример #1
0
        public void SetMtu(uint mtu)
        {
            Logger.Debug($"Setting MTU on Interface({IntfIndex})");
            var r = IPNetHelper.InitInterface(IntfIndex);

            r.NlMtu = mtu;
            IPNetHelper.SetInterface(r);
        }
Пример #2
0
        public void RestoreMetric()
        {
            Logger.Debug($"Restoring Metric on Interface({IntfIndex})");
            var r = IPNetHelper.InitInterface(IntfIndex);

            r.Metric             = _defaultInterfaceMetric;
            r.UseAutomaticMetric = 1;
            IPNetHelper.SetInterface(r);
        }
Пример #3
0
        public void SetMetric(uint metric)
        {
            Logger.Debug($"Setting Metric on Interface({IntfIndex})");
            var r = IPNetHelper.InitInterface(IntfIndex);

            r.Metric             = metric;
            r.UseAutomaticMetric = 0;
            IPNetHelper.SetInterface(r);
        }
Пример #4
0
        public void SetIgnoreDefaultRoute(bool setting)
        {
            Logger.Debug(setting
                ? $"Ignoring Default Route on Interface({IntfIndex})"
                : $"Reverting Default Route on Interface({IntfIndex})");
            var r = IPNetHelper.InitInterface(IntfIndex);

            r.DisableDefaultRoutes = (byte)(setting ? 1 : 0);
            IPNetHelper.SetInterface(r);
        }