{"id":2144,"date":"2018-12-05T21:39:57","date_gmt":"2018-12-05T20:39:57","guid":{"rendered":"http:\/\/sophie-matthieu.eu\/?p=2144"},"modified":"2020-01-17T13:36:45","modified_gmt":"2020-01-17T12:36:45","slug":"technologiesevents-pocket-wifi-to-ethernet-bridge","status":"publish","type":"post","link":"https:\/\/sophie-matthieu.eu\/index.php\/2018\/12\/05\/technologiesevents-pocket-wifi-to-ethernet-bridge\/","title":{"rendered":"#TechnologiesEVENTS &#8211; \u00ab\u00a0Pocket  Wifi to Ethernet Bridge\u00a0\u00bb"},"content":{"rendered":"<p>Conversion d un Raspberry Pi sous Raspbian Stretch. Sa fonction est de ce connecter au wifi&nbsp; d un smartphone en mode \u00ab\u00a0partage de donn\u00e9es\u00a0\u00bb \/ hot Spot et de pouvoir forwarder le Wifi sur le port Ethernet<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/encrypted-tbn0.gstatic.com\/images?q=tbn:ANd9GcQtw9SzpCpXFFqCtGBYgq6JMmfll5CSltMon6isQyJ264naygpOXw\" alt=\"R\u00c3\u00a9sultat de recherche d'images pour &quot;wifi to ethernet&quot;\"><\/p>\n<p>Quelques lignes de commandes sur le Raspberry via SSH ou avec un \u00e9cran et un clavier branch\u00e9s sur le Raspberry<\/p>\n<p>Setup :<\/p>\n<p>On peut utiliser Raspi-config pour configurer le Wifi ou en ligne de commande :<\/p>\n<pre><code>sudo su<\/code> <code>nano \/etc\/wpa_supplicant\/wpa_supplicant.conf<\/code><\/pre>\n<pre><code># \/etc\/wpa_supplicant\/wpa_supplicant.conf\ncountry=FR\nctrl_interface=DIR=\/var\/run\/wpa_supplicant GROUP=netdev\nupdate_config=1\n\nnetwork={\n    ssid=\"YOUR SSID\"\n    psk=\"YOUR PASSWORD\"\n}<\/code><\/pre>\n<pre>- <code>apt-get update &amp;&amp; apt-get install dnsmasq<\/code><\/pre>\n<pre><code>- mkdir -p \/etc\/iptables<\/code><\/pre>\n<pre><code>cat &lt;&lt;'EOF' &gt;\/etc\/iptables\/rules.v4\n# Generated by iptables-save v1.6.0 on Sat Apr 14 22:29:00 2018\n*nat\n:PREROUTING ACCEPT [98:9304]\n:INPUT ACCEPT [98:9304]\n:OUTPUT ACCEPT [2:152]\n:POSTROUTING ACCEPT [0:0]\n-A POSTROUTING -o wlan0 -j MASQUERADE\nCOMMIT\n# Completed on Dec 5 2018\n# Generated by iptables-save v1.6.0 on Dec 5, 2018\n*filter\n:INPUT ACCEPT [791:83389]\n:FORWARD ACCEPT [0:0]\n:OUTPUT ACCEPT [333:34644]\n-A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT\n-A FORWARD -i eth0 -o wlan0 -j ACCEPT\nCOMMIT\n# Completed on Dec 5 2018\nEOF<\/code><\/pre>\n<pre><code>cat &lt;&lt;'EOF' &gt;\/etc\/network\/if-up.d\/iptables\n#!\/bin\/sh\niptables-restore &lt; \/etc\/iptables\/rules.v4\nEOF<\/code><\/pre>\n<pre><code>chmod +x \/etc\/network\/if-up.d\/iptables<\/code><\/pre>\n<pre><code>sed -i'' \\\n    s\/#net.ipv4.ip_forward=1\/net.ipv4.ip_forward=1\/ \\\n    \/etc\/sysctl.conf<\/code><\/pre>\n<pre><code>cat &lt;&lt;'EOF' &gt;\/etc\/network\/interfaces.d\/eth0\nauto eth0\nallow-hotplug eth0\niface eth0 inet static\n  address 10.1.1.1 #Mettre votre Plan d adresse IP\n  netmask 255.255.255.0 #Mettre votre Plan d adresse IP\n  gateway 10.1.1.1  #Mettre votre Plan d adresse IP\nEOF<\/code><\/pre>\n<pre><code>cat &lt;&lt;'EOF' &gt;\/etc\/dnsmasq.d\/bridge.conf\ninterface=eth0\nbind-interfaces\nserver=8.8.8.8\ndomain-needed\nbogus-priv\ndhcp-range=10.1.1.2,10.1.1.254,12h # Mettre votre Range de Dhcp d\u00e9livrait par la prise Ethernet\nEOF<\/code><\/pre>\n<pre><code>reboot<\/code><\/pre>\n<pre><code>iptables -L<\/code><\/pre>\n<pre>Tous \u00c9quipements branch\u00e9s sur le port Ethernet auront une Adresse de DHCP pour un baille de 12h. Si pas d adresse fixe  hors des ranges du DHCP<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Conversion d un Raspberry Pi sous Raspbian Stretch. Sa fonction est de ce connecter au wifi&nbsp; d un smartphone en mode \u00ab\u00a0partage de donn\u00e9es\u00a0\u00bb \/ hot Spot et de pouvoir forwarder le Wifi sur le port Ethernet &nbsp; Quelques lignes de commandes sur le Raspberry &hellip; <a href=\"https:\/\/sophie-matthieu.eu\/index.php\/2018\/12\/05\/technologiesevents-pocket-wifi-to-ethernet-bridge\/\" class=\"more-link\"><span>Continue reading<span class=\"screen-reader-text\">#TechnologiesEVENTS &#8211; \u00ab\u00a0Pocket  Wifi to Ethernet Bridge\u00a0\u00bb<\/span><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3156,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8,14],"tags":[],"_links":{"self":[{"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/posts\/2144"}],"collection":[{"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/comments?post=2144"}],"version-history":[{"count":9,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/posts\/2144\/revisions"}],"predecessor-version":[{"id":2616,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/posts\/2144\/revisions\/2616"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/media\/3156"}],"wp:attachment":[{"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/media?parent=2144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/categories?post=2144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sophie-matthieu.eu\/index.php\/wp-json\/wp\/v2\/tags?post=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}