LoginSignup
0
0

More than 1 year has passed since last update.

openbsd で wifi router

Last updated at Posted at 2021-07-26

1.jpg

こういった安定性は Linuxで実現するのは 難しいです。 直接にpfはやっかいで ufwというツールを利用すればできますがこのメインテナンスが結構複雑です
この openbsd マシンは USB WIFI(urtwn0)で 某メーカーの wifi router とつながって インターネットにでてます。 これにさらにUSB WIFI(ural0) をつけて スマホをopenbsd マシン経由で インターネットにだします。 このopenbsd マシンでつくったwifi routerのパスワード 12345678は 突然の訪問客に教えます

indas.jpg
(出典は www.youtube.com/watch?v=Nc-YSb5JKuE&t=5s )

スマホ〜〜〜ural0:openbsd:urtwn0~~~wifi router ---> internet

dhcpd

69# ./comment-out.bat /etc/dhcpd.conf                                                  
option  domain-name "my.domain";
option  domain-name-servers 8.8.8.8;
subnet 192.168.12.0 netmask 255.255.255.0 {
        option routers 192.168.12.1;
        range 192.168.12.11 192.168.12.15;
}



69# ./comment-out.bat /etc/dhcpd.interfaces                                            
ural0

pf


/comment-out.bat /home/bsd/wifi-router.pf                                             <
ext=urtwn0
icmp_types = "{echoreq, unreach}"
set block-policy return
set loginterface $ext
set skip on lo0
match in all scrub (no-df max-mss 1440)
match out on $ext inet from !($ext:network) to any nat-to ($ext:0)
block log all
pass out quick
pass in quick inet proto { tcp udp gre } from any to any
pass in quick inet proto icmp all icmp-type $icmp_types keep state

router

69# ./comment-out.bat /etc/sysctl.conf                                                 
net.inet.ip.forwarding=1    # 1=Permit forwarding (routing) of IPv4 packets



comment-out.bat /home/bsd/wifi-router.bat                                             <
ifconfig ural0 inet 192.168.12.1 netmask 255.255.255.0 \
media autoselect mediaopt hostap nwid ore \
wpakey 12345678 chan 1 up
/etc/rc.d/dhcpd -f restart
pfctl -f /home/bsd/wifi-router.pf


なお当然

69# cat /etc/hostname.ural0
cat: /etc/hostname.ural0: No such file or directory



69# ./comment-out.bat /etc/rc.local 
/home/bsd/wifi-router.bat

これにて結果的には

ifconfig                                                                           
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
    index 3 priority 0 llprio 3
    groups: lo
    inet 127.0.0.1 netmask 0xff000000


em0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
    index 1 priority 0 llprio 3
    media: Ethernet autoselect (none)
    status: no carrier
enc0: flags=0<>
    index 2 priority 0 llprio 3
    groups: enc
    status: active

ural0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    index 4 priority 4 llprio 3
    groups: wlan
    media: IEEE802.11 autoselect hostap (autoselect mode 11g hostap)
    status: active
    ieee80211: nwid ore chan 1 -10dBm wpakey wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
    inet 192.168.12.1 netmask 0xffffff00 broadcast 192.168.12.255


urtwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    index 5 priority 4 llprio 3
    groups: wlan egress
    media: IEEE802.11 autoselect (OFDM54 mode 11g)
    status: active
    ieee80211: nwid WirelessAP chan 7 bssid  -46dBm wpakey wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
    inet 192.168.188.8 netmask 0xffffff00 broadcast 192.168.188.255



pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33136
    index 6 priority 0 llprio 3
    groups: pflog

5.jpg

人が一人死んでも 地球全体の重さはかわらないです。
われわれは 土にではなく 地球に帰ります
つまり 
存在し続けるのは mother earth(母なる地球)

自分の体重60KGの60%が水だとすると 

水分子は
(36*10*10*10/18)*(6*10の23乗) 個
12*(10の26乗)
となります。

https://www.water-kawaguchi.jp/object/mizunohanasi41.pdf
によると 地球の水分は
13.86億k㎥ 13*(10の8乗)*{(1000*100)の3乗}立方cm
つまり 13.86*(10の23乗)

割り算をします。
{12*(10の26乗)}÷ {13.86*(10の23乗)}
=0.8658*(10の3乗)
=8億

つまり 地球の水分の1cmの立方体の中に
元の自分を構成していた水分子が865個あります
従って 私の一部は桜になり マグロになり 象になり ヒトになるでしょう 
 



(計算間違いしてたら教えてください)


0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0