diff options
author | neodarz <neodarz@neodarz.net> | 2018-11-27 15:37:48 +0100 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-11-27 15:38:23 +0100 |
commit | 15a404e6a0d95383f02423860a599ad987830424 (patch) | |
tree | 9d436add216637e8da066f6f85611306dfc4ba85 /cheat/.cheat/sharing_internet | |
parent | 8e781f77466eb7ee6b78301042a37b5f61766e70 (diff) | |
download | dotfiles_ascii-15a404e6a0d95383f02423860a599ad987830424.tar.xz dotfiles_ascii-15a404e6a0d95383f02423860a599ad987830424.zip |
Add some cheat
Diffstat (limited to 'cheat/.cheat/sharing_internet')
-rw-r--r-- | cheat/.cheat/sharing_internet | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cheat/.cheat/sharing_internet b/cheat/.cheat/sharing_internet new file mode 100644 index 0000000..8dca3b5 --- /dev/null +++ b/cheat/.cheat/sharing_internet @@ -0,0 +1,44 @@ +# First connect machines ! + +# Enable port fowrading +sysctl net.ipv4.ip_forward=1 + +# fowrwarding Wifi -> Ethernet +iptables -t nat -A POSTROUTING -o internet0 -j MASQUERADE +iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT +iptables -A FORWARD -i net0 -o internet0 -j ACCEPT + +# First setup of device +sudo ip link set up dev enp0s25 +sudo ip addr add 192.168.2.100/24 dev enp0s25 # arbitrary address + +# /etc/dhcpd.conf +option domain-name-servers 80.67.169.12, 80.67.169.40; +option subnet-mask 255.255.255.0; +option routers 192.168.4.100; +subnet 192.168.4.0 netmask 255.255.255.0 { + range 192.168.4.150 192.168.4.250; + + host fenec { + hardware ethernet 5c:ff:35:09:ac:6a; + fixed-address 192.168.4.100; + } + +} + +# Service +# /etc/systemd/system/dhcpd4@.service +[Unit] +Description=IPv4 DHCP server on %I +Wants=network.target +After=network.target + +[Service] +Type=forking +PIDFile=/run/dhcpd4.pid +ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target + |