diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index c8617d3..9f1cc23 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -225,6 +225,46 @@
                 return response.data;
               });
         },
+        deleteIPV4: function(interfaceName, networkID) {
+          return $http({
+                   method: 'POST',
+                   url: DataService.getHost() +
+                       '/xyz/openbmc_project/network/' + interfaceName +
+                       '/ipv4/' + networkID + '/action/Delete',
+                   headers: {
+                     'Accept': 'application/json',
+                     'Content-Type': 'application/json'
+                   },
+                   withCredentials: true,
+                   data: JSON.stringify({'data': []})
+                 })
+              .then(function(response) {
+                return response.data;
+              });
+        },
+        addIPV4: function(
+            interfaceName, ipAddress, netmaskPrefixLength, gateway) {
+          return $http({
+                   method: 'POST',
+                   url: DataService.getHost() +
+                       '/xyz/openbmc_project/network/' + interfaceName +
+                       '/action/IP',
+                   headers: {
+                     'Accept': 'application/json',
+                     'Content-Type': 'application/json'
+                   },
+                   withCredentials: true,
+                   data: JSON.stringify({
+                     'data': [
+                       'xyz.openbmc_project.Network.IP.Protocol.IPv4',
+                       ipAddress, +netmaskPrefixLength, gateway
+                     ]
+                   })
+                 })
+              .then(function(response) {
+                return response.data;
+              });
+        },
         getLEDState: function() {
           var deferred = $q.defer();
           $http({
diff --git a/app/configuration/controllers/network-controller.js b/app/configuration/controllers/network-controller.js
index 5708ec8..5a6912f 100644
--- a/app/configuration/controllers/network-controller.js
+++ b/app/configuration/controllers/network-controller.js
@@ -14,6 +14,7 @@
     function($scope, $window, APIUtils, dataService, $route, $q) {
       $scope.dataService = dataService;
       $scope.network = {};
+      $scope.old_interface = {};
       $scope.interface = {};
       $scope.networkDevice = false;
       $scope.hostname = '';
@@ -25,6 +26,8 @@
 
       $scope.selectInterface = function(interfaceId) {
         $scope.interface = $scope.network.interfaces[interfaceId];
+        // Copy the interface so we know later if changes were made to the page
+        $scope.old_interface = JSON.parse(JSON.stringify($scope.interface));
         $scope.selectedInterface = interfaceId;
         $scope.networkDevice = false;
       };
@@ -47,6 +50,20 @@
           promises.push(setHostname());
         }
 
+        // Set IPV4 IP Addresses, Netmask Prefix Lengths, and Gateways
+        if (!$scope.interface.DHCPEnabled) {
+          for (var i in $scope.interface.ipv4.values) {
+            if ($scope.interface.ipv4.values[i].Address !=
+                    $scope.old_interface.ipv4.values[i].Address ||
+                $scope.interface.ipv4.values[i].PrefixLength !=
+                    $scope.old_interface.ipv4.values[i].PrefixLength ||
+                $scope.interface.ipv4.values[i].Gateway !=
+                    $scope.old_interface.ipv4.values[i].Gateway) {
+              promises.push(setIPV4(i));
+            }
+          }
+        }
+
         if (promises.length) {
           $q.all(promises).finally(function() {
             if (!$scope.set_network_error) {
@@ -89,6 +106,35 @@
                 });
       }
 
+      function setIPV4(index) {
+        // The correct way to edit an IPV4 interface is to remove it and then
+        // add a new one
+        return APIUtils
+            .deleteIPV4(
+                $scope.selectedInterface, $scope.interface.ipv4.ids[index])
+            .then(
+                function(data) {
+                  return APIUtils
+                      .addIPV4(
+                          $scope.selectedInterface,
+                          $scope.interface.ipv4.values[index].Address,
+                          $scope.interface.ipv4.values[index].PrefixLength,
+                          $scope.interface.ipv4.values[index].Gateway)
+                      .then(
+                          function(data) {},
+                          function(error) {
+                            console.log(JSON.stringify(error));
+                            $scope.set_network_error =
+                                $scope.interface.ipv4.values[index].Address;
+                          });
+                },
+                function(error) {
+                  console.log(JSON.stringify(error));
+                  $scope.set_network_error =
+                      $scope.interface.ipv4.values[index].Address;
+                });
+      }
+
       $scope.refresh = function() {
         $route.reload();
       };
@@ -101,6 +147,9 @@
           $scope.selectedInterface = $scope.network.interface_ids[0];
           $scope.interface =
               $scope.network.interfaces[$scope.selectedInterface];
+          // Copy the interface so we know later if changes were made to the
+          // page
+          $scope.old_interface = JSON.parse(JSON.stringify($scope.interface));
         }
       });
     }
