Changes between Version 1 and Version 2 of linux/bnetp


Ignore:
Timestamp:
2017/05/01 17:48:11 (7 years ago)
Author:
yuna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • linux/bnetp

    v1 v2  
    5858Bluetoothで接続するネットワークの設定をします。 
    5959{{{ 
    60 auto br-bnetp 
    61 face br-bnetp inet static 
    62         address 192.168.1.1 
     60auto bt-br 
     61iface bt-br inet static 
     62        address 192.168.12.1 
    6363        netmask 255.255.255.0 
    64         network 192.168.1.0 
    65         broadcast 192.168.1.255 
    66         gateway 192.168.1.254 
    67         bridge_ports enp2s0 
     64        network 192.168.12.0 
     65        broadcast 192.168.12.255 
     66        gateway 192.168.12.254 
    6867        dns-nameservers 8.8.8.8 
    6968}}} 
     
    7473 
    7574{{{ 
    76 dhcp-range=tag:bt-br,192.168.1.2,192.168.1.63,30m 
    77 dhcp-option=tag:bt-br,option:router,192.168.1.254 
     75dhcp-range=tag:bt-br,192.168.12.2,192.168.12.63,30m 
     76dhcp-option=tag:bt-br,option:router,192.168.12.1 
    7877dhcp-option=tag:bt-br,option:dns-server,8.8.8.8 
    7978}}} 
    8079 
    8180適当にdnsmasqパッケージをインストールして起動しておきます。 
    82  
    8381 
    8482== サービスの設定 
     
    9391 
    9492[Service] 
    95 ExecStart=/usr/local/bin/bt-pan server br-bnetp 
     93ExecStart=/usr/local/bin/bt-pan server bt-br 
    9694 
    9795[Install] 
     
    108106== Android側でBluetoothネットワークに接続 
    109107Bluetoothのデバイスを表示すると、「Internet access(インターネットアクセス)」という項目があるので、ONにするとインターネットアクセス可能になります。 
     108 
     109== Firewallの設定 
     110 
     111 
     112Bluetooth側のネットワークから、外にでれるようにNATの設定をします。 
     113 
     114{{{ 
     115# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.12.0/24 -j MASQUERADE 
     116# iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT 
     117# iptables -A FORWARD -i bt-br -o eth0 -s 192.168.12.0/24 -j ACCEPT 
     118}}} 
     119 
     120電源を切ると消えるので、永続化しておきます。 
     121 
     122{{{ 
     123# netfilter-persistent save 
     124}}}