Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanjaysunil/ip-assignment
Cross-platform dependency-free IP assignment npm module.
https://github.com/sanjaysunil/ip-assignment
dhcp interface ip ip-assign ip-assignment network static
Last synced: 21 days ago
JSON representation
Cross-platform dependency-free IP assignment npm module.
- Host: GitHub
- URL: https://github.com/sanjaysunil/ip-assignment
- Owner: SanjaySunil
- License: mit
- Created: 2022-08-26T12:01:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-30T12:02:18.000Z (over 2 years ago)
- Last Synced: 2024-12-11T02:51:43.564Z (about 2 months ago)
- Topics: dhcp, interface, ip, ip-assign, ip-assignment, network, static
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ip-assignment
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ip-assignment
Cross-platform dependency-free IP assignment module
Report Bug
·
Request Feature
## What's ip-assignment?
[ip-assignment]() is a cross-platform dependency free ip-assignment module. With ip-assignment, you can easily configure network interfaces in your own projects.
## Install
```sh
$ npm install ip-assignment
```## Usage
### [`examples/linux.js`](./examples/linux.js)
```js
const interfaces = require("ip-assignment");// This interface has a static IP
const eth0 = {
name: "eth0",
ip_address: "192.168.1.98",
subnet_mask: "24",
gateway: "192.168.1.1",
dns_server: "8.8.8.8",
alternate_dns_server: "8.8.4.4",
};// This interface has a DHCP IP
const wlan0 = {
name: "wlan0",
};interfaces.set([eth0, wlan0]);
```### [`examples/windows.js`](./examples/windows.js)
```js
const interfaces = require("ip-assignment");// This interface has a static IP
const Ethernet = {
name: "Ethernet",
ip_address: "192.168.1.99",
subnet_mask: "255.255.255.0",
gateway: "192.168.1.1",
dns_server: "8.8.8.8",
alternate_dns_server: "8.8.4.4",
};interfaces.set([Ethernet]);
```## License
Copyright © 2022 Sanjay Sunil ([email protected])
Distributed under the MIT License. See `LICENSE` for more information.