Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/carp3/networkinterfaces
A simple PHP library for reading and manipulating the /etc/network/interfaces file in Debian based distributions.
https://github.com/carp3/networkinterfaces
debian linux networking php
Last synced: about 1 month ago
JSON representation
A simple PHP library for reading and manipulating the /etc/network/interfaces file in Debian based distributions.
- Host: GitHub
- URL: https://github.com/carp3/networkinterfaces
- Owner: carp3
- License: mit
- Created: 2018-01-23T15:56:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-25T19:05:13.000Z (over 5 years ago)
- Last Synced: 2024-08-17T01:06:05.678Z (4 months ago)
- Topics: debian, linux, networking, php
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 11
- Watchers: 4
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Network Interfaces
A simple PHP library for reading and manipulating the /etc/network/interfaces file in Debian based distributions.Install:
```
composer require carp3/network-interfaces
```Usage:
```php
parse();// 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';// add adaptor to NetworkInterfaces instance
$handle->add($adaptor);// change eth0 ip address
$handle->Adaptors['eth0']->address = '192.168.0.30';// Write changes to /etc/networking/interfaces
$handle->write();// bringing up new interface
$handle->up('eth2');
````