Control your Orange Livebox (SoftAtHome) internet router using C# and .NET
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
README.md

README.md

LiveboxRouter

Provides a .NET library functions to connect to and control a Livebox 3 router from Sagemcom. This router is used for internet services offered by Orange in France, UK, Spain, Netherlands, Switzerland, Poland and other countries.

Wikipedia

Like my work? You can donate to this project using PayPal

Features

The library is in its early stages and built simply so that I could automate Firewall tasks when using DNS blocking services such as Unlocator. The following features have been implemented:

  • Login
  • Get Device Info
  • Get/Set Firewall levels
  • Get Firewall custom rules
  • Getting WAN network status

Todo:

  • Set Firewall custom rules (create new IP blocking rules)

Functionality

The test application that comes with the LiveboxAdapter.cs class (which is the main library file) is very simple. After typing in the username and password to your router you can press connect to verify that the application can connect to your LAN router. After the first time this is done the application will establish the connection automatically when started.

The app will indicate the current status of your router's firewall to indicate if the DNS block is in place or not.

You can then simply click the Enable block or disable block button to apply the necessary settings to your router.

Note: Currently the app only either applies the normal or custom firewall settings when the buttons are pressed. You can set up your custom rules by hand and then this will work for the time being. In the future I will add functionality to automatically create all the DNS blocking entries based on your DNS provider settings.

Examples

To obtain information about the device

LiveboxAdapter a = new LiveboxAdapter(username, password);
a.LoginAsync().OnSuccess((t, o) =>
{
  a.GetDeviceInfo().OnSuccess((t2, o2) =>
  {
    var res = t2.Result;
    // the res object is a typed device info object
  }
});

Setting the firewall level to medium

LiveboxAdapter a = new LiveboxAdapter(username, password);
a.LoginAsync().OnSuccess((t, o) =>
{
  a.SetFirewallToMedium().OnSuccess((t2, o2) =>
  {
      var res = t2.Result;
      if (!res.Status.GetValueOrDefault())
      {
          textbox.Text = "Error: " + res.Errors.First().Description;
      }
      else
      {
          textbox.Text = "Success: " + res.Status;
      }
  }, _uiScheduler);
});