Last active
November 12, 2015 05:34
-
-
Save faddat/b73d74997de0d4ca5d67 to your computer and use it in GitHub Desktop.
shell script and config files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iface eth0 inet manual | |
| up ifconfig $IFACE 0.0.0.0 up | |
| down ifconfig $IFACE down | |
| iface eth1 inet manual | |
| up ifconfig $IFACE 0.0.0.0 up | |
| down ifconfig $IFACE down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| description "Multi network manager" | |
| start on networking | |
| stop on runlevel [!2345] | |
| respawn | |
| respawn limit unlimited | |
| # 'sshd -D' leaks stderr and confuses things in conjunction with 'console log' | |
| console none | |
| exec /usr/local/sbin/multi_client -c /etc/init/multi.yaml -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get update | |
| apt-get install cmake git libiw-dev libglib2.0-dev libyaml-dev libmnl-dev build-essential | |
| ip link set eth1 up | |
| ip link set eth0 up | |
| git clone https://gist.github.com/b73d74997de0d4ca5d67.git | |
| cd b73d74997de0d4ca5d67 | |
| git clone https://github.com/kristrev/multi | |
| cd multi | |
| cmake src | |
| make | |
| make install | |
| cd .. | |
| cp multi.conf /etc/init/multi.conf | |
| cp interfaces /etc/network/interfaces | |
| echo "Please enter only the 4th block of the IP address. Example: if you enter 201, addresses will be given to 192.168.100.201 and 103.52.94.201: " | |
| read SERVERIP | |
| echo "You entered: $SERVERIP. Addresses will be assigned as: 192.168.100.$SERVERIP and 103.52.94.$SERVERIP" | |
| cat multi.yaml | sed -e "s/192.168.100.201/192.168.100.$SERVERIP/" | sed -e "s/103.52.94.201/103.52.94.$SERVERIP/" > /etc/init/multi.yaml | |
| echo "Confirm correct application of settings:" | |
| cat /etc/init/multi.yaml | |
| echo "You're about to lose your SSH connection. Server will be accessible at 192.168.100.$SERVERIP and 103.52.94.$SERVERIP. Hold onto your ass!" | |
| multi_client -c /etc/init/multi.yaml -d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| eth0: | |
| proto: 'static' | |
| address: 192.168.100.201 | |
| netmask: 255.255.255.0 | |
| gateway: 192.168.100.1 | |
| metric: 4 | |
| eth1: | |
| proto: 'static' | |
| address: 103.52.94.201 | |
| netmask: 255.255.255.0 | |
| gateway: 103.52.94.1 | |
| metric: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment