2017 © Pedro Peláez
 

library network-interfaces

A simple library to modify debian's /etc/netowrk/interfaces

image

carp3/network-interfaces

A simple library to modify debian's /etc/netowrk/interfaces

  • Saturday, January 27, 2018
  • by carp3
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Network Interfaces

A simple PHP library for reading and manipulating the /etc/network/interfaces file in Debian based distributions., (*1)

Install:, (*2)

composer require carp3/network-interfaces

Usage: ```php <?php //include composer autoloader include 'vendor/autoload.php';, (*3)

// 'import' NetworkInterfaces class use NetworkInterfaces\Adaptor; use NetworkInterfaces\NetworkInterfaces;, (*4)

// create new handle from /etc/networking/interfaces $handle = new NetworkInterfaces('/etc/networking/interfaces');, (*5)

// parse file $handle->parse();, (*6)

// create new Adaptor and set configs $adaptor = new Adaptor(); $adaptor->name = "eth2"; $adaptor->family = "inet"; $adaptor->name = "statis"; $adaptor->address = '192.168.2.100'; $adaptor->gateway = '192.168.2.1'; $adaptor->netmask = '255.255.255.0'; $adaptor->auto = true; $adaptor->allows[] = 'hotplug';, (*7)

// add adaptor to NetworkInterfaces instance $handle->add($adaptor);, (*8)

// change eth0 ip address $handle->Adaptors['eth0']->address = '192.168.0.30';, (*9)

// Write changes to /etc/networking/interfaces $handle->write();, (*10)

// bringing up new interface $handle->up('eth2'); ````, (*11)

The Versions

27/01 2018

dev-master

9999999-dev

A simple library to modify debian's /etc/netowrk/interfaces

  Sources   Download

MIT

The Requires

  • php ^7.0

 

by Pedram Azimaie