I am using the Raspberry Pi Model 2 B with 1 GB RAM with the EDIMAX nano USB Adapter. At first I was using NOOBS on the Rapsberry Pi and wanted to set up an ad-hoc network between two such Pi's.
I tried configuring one of the RPi with the same configurations as mentioned below:
#etc/network/interfaces for pi-1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.50.1
netmask 255.255.255.0
wireless-channel 12
wireless-essid pi-adhoc
wireless-mode ad-hoc
#etc/network/interfaces for pi-2
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.50.2
netmask 255.255.255.0
wireless-channel 12
wireless-essid pi-adhoc
wireless-mode ad-hoc
I have set Pi-1 as a DHCP server (using the ISC-DHCP-Server Daemon) so that I can SSH into the Ad-hoc network to the Pi's for ease of accessibility through my Laptop. The DHCP Server configurations are as follows:
ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;
option subnet-mask 255.255.255.0;
option domain-name "pi-adhoc";
subnet 192.168.50.0 netmask 255.255.255.0 {
range 192.168.50.3 192.168.50.150;
}
and then run the daemon
pi-1 ~$ sudo service isc-dhcp-server start
I also force the Pi's to join the ad-hoc network by configuring the rc.local files on both of them as follows:
#! /bin/bash
# For Pi-1 /etc/rc.local
adhocNetwork(){
echo "connecting to ad hoc network"
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid pi-adhoc
iwconfig wlan0 channel 12
ifconfig wlan0 192.168.50.1 netmask 255.255.255.0 up
echo "connected to ad hoc network"
}
adhocNetwork
exit 0
#! /bin/bash
# For Pi-2 /etc/rc.local
adhocNetwork(){
echo "connecting to ad hoc network"
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 essid pi-adhoc
iwconfig wlan0 channel 1
ifconfig wlan0 192.168.50.2 netmask 255.255.255.0 up
echo "connected to ad hoc network"
}
adhocNetwork
exit 0
Inferences
When I use my WiFi on my Laptop and connect to the pi-adhoc network created by the Pi's I get an IP address from the DHCP Server from the pool from Pi-1 and can ssh into the Pi-1 and just to check connectivity I can Ping the laptop from RPi to Laptop and vice versa.
When I try to Ping Pi-2 from Pi-1, it is unreachable and vice versa. But I can connect to the Pi-2 from the Laptop and vice versa.
Scenario: PI-1 <---> Laptop and PI-2 <---> Laptop
but NO connectivity from PI-1 <--/--> PI-2
I cannot connect the Pis together.
I also upgraded the NOOBS to Wheezy using the following:
sudo apt-get update
sudo apt-get dist-upgrade
But the Problem still Exists.
Any help would be appreciated. Thanks.
So finally the connectivity issue has been resolved provided if one does not use the Edimax EW7811UN Wireless Dongle. The problem is related to a driver which is not supported for Linux Kernels past 3.9 versions. The driver specifically is called 802nl11 driver.
An alternate solution which solves the connectivity is using WiFi dongles which have the Ralink RTL5370 drivers in them. I am currently using LogiLink WL0145 Wireless N USB Adapter.
A good check for drivers can be done using lsusbcommand when the USB dongle is connected to the RPi. Now with the same configurations I can ping both the Raspberry Pis.
Inference
There has been a driver compatibility issue with the Model B+ for Raspberry Pis when using Edimax Dongles particularly in Ad-Hoc Mode. Hence it is advisable to switch to other WiFi Dongles when using RPis in Ad-Hoc mode particularly ones with Ralink Technology RT5370 Wireless Adapters.
Check with Jessie
There is still no support for Edimax 7811UN for Ad Hoc mode for Jessie and Jessie Lite 8.0
The issue is that for some reason at least in Debian Jessie 4.1.13-v7+. The RTL8192cu driver does not support broadcasting for the Edimax EW7811UN Wireless Dongle in ad-hoc mode.
However, if ssh-ing between Raspberry Pi is all the functionality you need. You may insert a manual arp entry in your ARP table that prevents the need to perform an ARP Broadcast to resolve a MAC Address to IP Address Association.
In the Raspberry Pi with IP address 192.168.50.1 do this:
arp -s 192.168.50.2 [MAC Address of Wireless Dongle on other Raspberry Pi]
In the Raspberry Pi with IP address 192.168.50.2 do this:
arp -s 192.168.50.1 [MAC Address of Wireless Dongle on other Raspberry Pi]
After you have done this, you should be able to ssh into the Raspberry Pis and ping the Raspberry Pis too. But be aware that for any protocol that requires broadcasting, it will not work on the Edimax EW7811UN Wireless Dongle in ad-hoc mode.
Alternatively, if you'd like a Wireless Dongle that works out of the box in ad-hoc mode. I'd highly recommend TP-Link TL-WN722N. I have tried this and it works.
Related
My device is running on Debian OS strech version (not desktop).
I am not an IT personal, but a programmer. I need to know how to configure the network on the debian so both PPP cellular modem & the ethernet interface can access the internet.
There are 3 network interfaces:
1. Ethernet interface enp1s0: dhcp client. (gets ip from the dhcp server and access to the internet)
2. Ethernet interface snp2s0: static ip
3. Modem PPP: wvdial gets access to the internet using the modem
/etc/network/interface file:
auto lo
iface lo inet loopback
allow-hotplug enp1s0
iface enp1s0 inet dhcp
auto enp2s0
iface enp2s0 inet static
address 10.0.13.1
netmask 255.0.0.0
manual ppp0
iface ppp0 inet wvdial
ip route
default via 10.0.0.100 dev enp1s0
10.0.0.0/24 dev enp1s0 proto kernel scope link src 10.0.0.11
10.0.0.0/8 dev enp2s0 proto kernel scope link src 10.0.13.1
/etc/resolv.conf file:
domain mydomain.local
search mydomain.local
nameserver 10.0.0.3
/etc/wvdial.conf file:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Init3 = AT+CGDCONT=1,"IP","internetg"
Init4 = AT+CGATT=1
Phone = *99***1#
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyACM2
ISDN = 0
Password = ''
Username = ''
Auto DNS = Off
/etc/ppp/peers/wvdial file:
noauth
name wvdial
usepeerdns
Problem:
1. My device is running and enp1s0 is connected to the internet. (modem is down)
2. I then run command to perform dialup of the ppp: ifup ppp0
3. As a result the device ppp0 appears in the 'ip a' command, but the ethernet interface enp1s0 is not connected to the internet anymore and also the modem is not connected, but has ip which means there is some problem with routing table and/or dns.
After dialup the ip route table does not have any default/rule for the PPP.
ip route:
default via 10.0.0.100 dev enp1s0
10.0.0.0/24 dev enp1s0 proto kernel scope link src 10.0.0.11
10.0.0.0/8 dev enp2s0 proto kernel scope link src 10.0.13.1
After dialup I noticed that the /etc/resolv.conf file changed and the dns of the ethernet interface is deleted and now appears the PPP dns entries:
/etc/resolv.conf
nameserver 194.90.0.11
nameserver 212.143.0.11
domain mydomain.local
search mydomain.local
The network should behave as follows:
1. If both PPP and ethernet interface are up, then both should have access to the internet at the same time
2. If only 1 of the devices are up (PPP or ethernet interface) then it should work
3. Dialup/Dialdown should not affect the ethernet connection to the internet
What are the exact commands needed and file configuration in order to be able to have PPP and ethernet interface enp1s0 work at the same time?
- ip routing table
- dns
- wvdial
for default route, add defaultroute and replacedefaultroute option to /etc/ppp/peers/wvdial file.
Recently we brought raspberry pi 3b.Beginning we used to access the internet using an ethernet cable and it used to connect properly but now raspberry pi is not able to reach the gateway itself and it's taking its default IP address i.e 169.xxx.xxx.xx.
what would be the issue?we tried to reinstalling the operating system again the same issue .it worked for one day after that same problem.so please help me to solve the issue.
Finally, I am able to figure it out after trial and error method. I have missed "auto eth0" before the iface statement i.e
auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
network 255.255.255.0
gateway xxx.xxx.xxx.xxx
dns-nameservers 8.8.8.8
Assuming that you have a windows computer available, open cmd and run the following command:
ipconfig
note down the values that display. Now on your pi, enter the command
sudo nano /etc/network/interfaces
This will open the network interfaces file. Look for the line similar to 'inet eth0 inet manual' Then remove this line and everything to do with the eth0 interface, since we are going to start over.
in the interfaces file, add the following section:
auto eth0
inet eth0 inet static
address xxx.xxx.xxx.xxx
network 255.255.255.0
gateway xxx.xxx.xxx.xxx
dns-nameservers 8.8.8.8
Replace the x in address with the first 3 groups of the value taken from the windows system. For example, if the ip address on the windows system was 192.168.0.221, enter 192.168.0.xxx
The last group of xxx for address should be something unique to everything else on your network.
'gateway' should be whatever the gateway value in windows was (assuming these machines are on the same network)
[Ctrl]+[x], Save changes
reboot via
sudo reboot
once the system has rebooted
ifconfig eth0
should list the new settings. Test them by pinging the below address (google)
sudo ping 8.8.8.8
I have two PC in same subnet and connected via switch. When I do arp -a the other IP address is shown but I cant ping the other PC.
It is shown in arp, but maybe it is cached, and currently not reachable. Try the following command, which outputs its current cache state:
ip neigh
For example, on my personal laptop, I have a wireless adapter (wlan0) and a wired one (eth0), both connected to the same network (my home router). With arp -a it displays
? (192.168.1.1) en xx:xx:xx:xx:xx:xx [ether] en wlan0
? (192.168.1.1) en xx:xx:xx:xx:xx:xx [ether] en eth0
and with ip neigh it shows
192.168.1.1 dev wlan0 lladdr xx:xx:xx:xx:xx:xx STALE
192.168.1.1 dev eth0 lladdr xx:xx:xx:xx:xx:xx REACHABLE
As seen with ip neigh, the wireless one is in the STALE state, cause it is not being used, but arp -a does not displays it.
I am new to openstack and I followed the installation guide of icehouse for ubuntu 12.04/14.04
I chose 3 node architecture. Controller, Nova, Neutron.
The 3 nodes are installed in VM's. I used nested KVM. Inside VM's kvm is supported so nova will use virt_type=kvm. In controller I created 2 nics. eth0 is a NAT interface with ip 203.0.113.94 and eth1 a host only interface with ip 10.0.0.11.
In nova there are 3 nics. eth0 NAT - 203.0.113.23, eth1 host only 10.0.0.31 and eth2 another host only 10.0.1.31
In neutron 3 nics. eth0 NAT 203.0.113.234, eth1 host only 10.0.0.21 and eth2 another hosty only 10.0.1.21 (during installation guide in neutron node i created a br-ex (and a port to eth0) which took the settings of eth0 and eth0 settings are:
auto eth0 iface eth0 inet manual up ifconfig $IFACE 0.0.0.0 up
up ip link set $IFACE promisc on
down ip link set $IFACE promisc off
down ifconfig $IFACE down)
Everything seemed fine. I can create networks, routers etc, boot instances but I have this error.
When I launch an instance it takes a fixed ip but when I log in into instance (cirros) can't ping anything. ifconfig with no ip.
I noticed that in demo-net (tenant network) properties under subnet in the ports field it has 3 ports. 172.16.1.1 network:router_interface active 172.16.1.3 network:dhcp active 172.16.1.6 compute:nova down
I searched for solutions over the net but couldn't find anything!
Any help?
Ask me if you want specific logs because I don't know which ones to post!
Thanks anyway!
Looks like you are using Fixed IP to ping..If so please assign floating IP to your instance, and then try to ping..
If you have already assigned floating IP and you are pinging using that IP..please upload log of your instance
Settings in /etc/network/interfaces seems to have no effect on my BeagleBone Black Version C. I want to set my beaglebone black's ethernet IP address to a static IP as I have done with all my other internet-of-things devices running Debian. I edited /etc/network/interfaces as I have before, but I do not see any changes via ifconfig. This is after a restart of networking AND a restart of the beaglebone. I have googled somewhat, and posted to the beaglebone forums after searching them, and I still do not have a solution. I noticed a commented line in interfaces suggesting that the settings are set via an init script, but this is where I get a little lost. I have moderate knowledge of Debian, but I have not peeled back enough layers apparently. I am connecting my beaglebone black via ethernet connector. WIFI is a beast I will tackle later.
I set my router to reserve a specific IP based on MAC ID, but I would like to know what I am missing here.
iface usb0 inet static
address 192.168.0.103
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
iface eth0 inet static
address 192.168.0.102
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
You are missing the auto line
auto eth0
iface eth0 inet static
address 192.168.0.102
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
(Just for diagnosis) - Also remove the gateway line from it
and after you get the connection run this command to add the gateway
root prompt :) #
route add default gateway 192.168.0.1
i was playing around a lot with networking on it so i got the answer. Hope this resolve your issue do post.
Do the configurations in wicd. Run "wicd-client" which opens GUI to make the configuration. Apparently wicd configurations overwrite what you do in /etc/network/interfaces
Another alternative to setting the ipaddress to be static on boot. Even without a ethernet jack plugged in, which was my issue.
Caution: this is hacky, and there probably better streamlined approach
Edit the /opt/scripts/boot/autoconfigure_usb0.sh script
line 92 and 139 set the usb0 default ipaddress
/sbin/ifconfig usb0 ${deb_usb_address} netmask ${deb_usb_netmask} || true
insert the following line after it, in both places
/sbin/ifconfig usb0 ${deb_usb_address} netmask ${deb_usb_netmask} || true
/sbin/ifconfig eth0 192.168.0.123 netmask 255.255.255.0 || true
then it will boot up with that as the static IP address even if you don't have anything plugged it.