Skip to content

Instantly share code, notes, and snippets.

@kou029w
Last active January 10, 2019 09:11
Show Gist options
  • Save kou029w/7c717118648994c8d84f74b39516f7c5 to your computer and use it in GitHub Desktop.
Save kou029w/7c717118648994c8d84f74b39516f7c5 to your computer and use it in GitHub Desktop.
@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

ipv6のフォワーディング設定か??未検証

@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

ufw の DEFAULT_FORWARD_POLICY を ACCEPT に変更する必要があったのかな?無効にしたんだからそれはないか

@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

いや、やっぱり必要あるかも
DEFAULT_FORWARD_POLICY はやりすぎ感あるので
-A FORWARD -i wlan0 -j ACCEPT
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT

などで。forwardはufw-before-forwardにしてもよさそう

@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

before.rules の末尾に追加

*nat
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.0.0/24 -o ppp0 -j MASQUERADE
COMMIT

@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

ipアドレスを固定するなどかなあ
ルーターが見つからないようだし

@kou029w
Copy link
Author

kou029w commented Sep 3, 2017

169.254.XXX.XXXになってるしDHCPサーバーに問題があるんだろうな...

@kou029w
Copy link
Author

kou029w commented Sep 4, 2017

そもそもdhcpcd.conf設定しなくていいんだっけ?

@kou029w
Copy link
Author

kou029w commented Sep 4, 2017

dnsmasq.conf の dhcp-range に合わせ /etc/dhcpcd.conf に以下を加える

interface wlan0
static ip_address=192.168.0.1/24

Wheezy 以前の場合は /etc/dhcpcd.conf ではなく /etc/network/interfaces に加える

auto wlan0
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0

@kou029w
Copy link
Author

kou029w commented Sep 4, 2017

だがうまくいかず。。。
dnsmasq消して、isc-dhcp-server つかってみるか

@kou029w
Copy link
Author

kou029w commented Sep 4, 2017

sudo apt install isc-dhcp-server

/etc/dhcp/dhcpd.conf

7,8c7,8
< option domain-name "example.org";
< option domain-name-servers ns1.example.org, ns2.example.org;
---
> option domain-name "raspberrypi.local";
> option domain-name-servers 8.8.8.8, 8.8.4.4;
21c21
< #authoritative;
---
> authoritative;
107a108,113
>
> subnet 192.168.0.0 netmask 255.255.255.0 {
>   range 192.168.0.10 192.168.0.50;
>   option broadcast-address 192.168.0.255;
>   option routers 192.168.0.1;
> }

/etc/default/isc-dhcp-server

17,18c17,18
< INTERFACESv4=""
< INTERFACESv6=""
---
> INTERFACESv4="wlan0"
> INTERFACESv6="wlan0"

@kou029w
Copy link
Author

kou029w commented Sep 4, 2017

できたー!

@kou029w
Copy link
Author

kou029w commented Sep 13, 2017

/etc/default/isc-dhcp-server の v6 の有効化と /etc/dhcp/dhcp6.conf にpublic dnsを追加した

@kou029w
Copy link
Author

kou029w commented Sep 13, 2017

ipv6 なんて無効化してやる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment