https://github.com/winglim/auto-dhcp-option
A script to auto set Main Router's dhcp_option.
https://github.com/winglim/auto-dhcp-option
Last synced: 3 months ago
JSON representation
A script to auto set Main Router's dhcp_option.
- Host: GitHub
- URL: https://github.com/winglim/auto-dhcp-option
- Owner: WingLim
- License: mit
- Created: 2020-12-14T16:07:13.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T10:56:32.000Z (over 4 years ago)
- Last Synced: 2025-01-16T12:52:40.746Z (5 months ago)
- Language: Shell
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Auto-DHCP-Option
A script to auto set Main Router's dhcp_option.
## Introduction
Our network topology:

`3` means Gateway's IP and `6` means DNS Server's IP.
But there is an problem: **If our Side Router down, we can't connect to Internet.**
So, this script will check Side Router status, if it is down, remove `dhcp_option`.
If Side Router is down, we can manually reconnect devices to Main Router, and use Internet normally.
## Usage
### Install
Run below command in **Main Router**.
```shell
wget https://raw.githubusercontent.com/WingLim/dotfiles/Auto-DHCP-Option/ado_init.sh
sh ado_init.sh init your_side_router_ip
```Script will creat a dir name `auto_dhcp_option` and generate `check_status.sh` in it.
Add a cron to execu `check_status.sh` every 10 mins.
### Remove
```shell
sh ado_init.sh remove
```## License
MIT