In this paper, we present a scheme for minimizing packet loss in OSPF networks by optimizing link weights using Online Simulation. We have chosen packet loss rate in the network as the optimization metric as it is a good indicator of congestion and impacts the performance of the underlying applications. We have formulated packet loss rate in the network in terms of the link parameters, such as bandwidth and buffer space, and the parameters of the traffic demands. A GI/M/1/K queuing model has been used to compute the packet drop probability on a given link. The problem of optimizing OSPF weights is known to be NP-hard even for the case of a linear objective function [4]. We use Online Simulation (OLS) framework [14] to search for a good link weight setting and as a tool for automatic network management. OLS uses fast, scalable recursive random search (RRS) algorithm to search the parameter space. Our results demonstrate that the RRS takes 50-90% fewer function evaluations as compared ...