AntoineCompagnie
Posts: 10
Joined: Mon May 16, 2016 8:22 pm

Shy RPi becomi highly secured router to navigate anonymously

Fri May 20, 2016 9:33 pm

I feel My Raspberry is to shy and needs to navigate the web anonymously. I want to transform my Raspberry Pi as an highly secured router to navigate anonymously wherever I would be thanks to Onion Pi. (Actually I'm doing some tutorials in order to have a better understanding of Raspberry, networking and addresses.) Yet, I wasn't able to give to my Raspberry a static IP address. It's saying there is No such device to assign the address. Indeed, after having followed the following steps:

[*]SSH connexion to my Raspberry Pi: ssh [user]@[IP address]
[*]installed the Dynamic Host Configuration Protocol sudo get-apt install hstapd isc-dhcp-server
[*]configured DHCP by adding a # to the two options about domain name a,d suppressing # in front of the authoritative option seven lines under

[*]adding

Code: Select all

    subnet 192.168.42.0 netmask 255.255.255.0 {
        range 192.168.42.10 192.168.42.50;
        option broadcast-adress 192.168.42.255;
        option routers 192.168.42.1;
        default-lease-time 600;
        max-lease-time 7200;
        option domain-name "local";
        option domain-name-servers 8.8.8.8,
        8.8.4.4;
    }
to the file and saving it,

[*]modified the DHCP server settings in order to be able to use it with a wireless adaptor: Interfaces ="wlan0"

[*]set the Wifi adaptator twith a static address an enabling it to receive incoming signals sudo nano /etc/network/interfaces adding a # to iface wlan 0 and to the following lines abiut anything connectod to wlan0

[*]Finally give to the interface a static IP address (the XX are actual integers:

Code: Select all

    iface wlan0 inet static
    address 192.168.XX.X
    netmask 2555.2555.255.0
saving.

[*]When I try to assign the wlan0 address 192.168.XX.X it answers me:

Code: Select all

    :~ $ sudo ifconfig wlan0 192.168.XX.X
    SIOCSIFADDR: No such device
    wlan0: ERROR while getting interface flags: No such device
RaspberryPi 2 B - Inspiron 15 3000 series

HeyMrPolarBear
Posts: 6
Joined: Tue Nov 10, 2015 8:08 am

Re: Shy RPi becomi highly secured router to navigate anonymo

Mon May 23, 2016 8:24 am

set the Wifi adaptator twith a static address an enabling it to receive incoming signals sudo nano /etc/network/interfaces adding a # to iface wlan 0 and to the following lines abiut anything connectod to wlan0
I think that's your problem right there. You commented out the line that enables your wireless card in the interfaces file.

I did the Onion Pi thing at home and if I recall correctly my wlan config is

Code: Select all

iface wlan0 inet dhcp
If that doesn't work post the output of

Code: Select all

sudo ifconfig -a

AntoineCompagnie
Posts: 10
Joined: Mon May 16, 2016 8:22 pm

Re: Shy RPi becomi highly secured router to navigate anonymo

Mon May 23, 2016 9:38 pm

Thank for answering my question! So I uncommented only iface wlan0 inet manual in sudo nano /etc/network/interfaces, transformed it into inet dhcp

I then did the command but I still have the problem

Code: Select all

:~ $ sudo ifconfig wlan0 192.168.42.1
SIOCSIFADDR: No such device
wlan0: ERROR while getting interface flags: No such device
so here is sudo ifconfig -a

Code: Select all

:~ $ sudo ifconfig -a
eth0      Link encap:Ethernet  HWaddr b8:27:eb:c7:c5:66  
          inet addr:192.168.0.33  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::c0f2:6df7:e27f:78c4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2510 errors:0 dropped:6 overruns:0 frame:0
          TX packets:959 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:246147 (240.3 KiB)  TX bytes:136258 (133.0 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:17376 (16.9 KiB)  TX bytes:17376 (16.9 KiB)
I tried to uncomment all lines at the end of sudo nano /etc/network/interfaces

Code: Select all

iface wlan0 inet static
adress 192.168.42.1
netmask 255.255.255.0

iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
But still, it doesn't work...
RaspberryPi 2 B - Inspiron 15 3000 series

HeyMrPolarBear
Posts: 6
Joined: Tue Nov 10, 2015 8:08 am

Re: Shy RPi becomi highly secured router to navigate anonymo

Tue May 24, 2016 10:05 am

It seems like your Pi is not detecting your wireless card at all and I just remembered that not every wireless card will work on the Pi to turn it into an Access Point. I did have to try 2 different USB wifi cards in order to get my Onion Pi working and this is per the Adafruit tutorial.

Can you post details of your wifi card?

Code: Select all

sudo lsusb
is a good place to start.

AntoineCompagnie
Posts: 10
Joined: Mon May 16, 2016 8:22 pm

Re: Shy RPi becomi highly secured router to navigate anonymo

Tue May 24, 2016 2:21 pm

Okay the main reason was very simple: I didn't plugged the wireless dongle into my Raspberry.

Yet, I have now a new problem, the connexion wasn't correctly transfered:
[*]
After configurating the Wlan0 by creating a new file about the new wireless network with :~ $ sudo nano /etc/hostapd/hostapd.conf

Code: Select all

interface=wlan0
driver=rtl871xdrv
ssid=COMPi
hw_mode=gchannel=1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=letterightonein
pa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
[*]then modified hostapd to point to this file:~ $ sudo nano /etc/default/hostapd

I only added

Code: Select all

DAEMON_OPTS="/etc/hostapd/hostapd.conf"
at the end of the file

[*]then doing the network addressing by setting a network address translation in order to remap one IP address space into another :~ $ sudo nano /etc/sysctl.conf

I added at the end:

Code: Select all

net.ipv4.ip_forward=1
I saved

[*]then I did:

Code: Select all

:~ $ sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
Finally I did three commands to be sure that the internet connexion was correctly transferred:

Code: Select all

pi@raspberrypi:~ $ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
pi@raspberrypi:~ $ sudo iptables -t nat -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables: No chain/target/match by that name.
RaspberryPi 2 B - Inspiron 15 3000 series

Return to “Networking and servers”