Can ping anther PC is same network connected by switch - networking

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.

Related

Raspberry Pi and Edimax 7811UN incompatibility in ad-hoc mode

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.

openstack instance getting ip and not getting ip

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

XEN VM networking, public IP binding

I need some information about routing public IP addresses assigned to the hypervisor into a VM.
I have installed XEN hypervisor on Centos 6.5, I have one NIC with IP 80.86.84.34 & Mask:255.255.255.0 I have an additional IP 85.25.14.195 & Mask: 255.255.255.255
Dom0 has eth0 & virbr0 with a virtual dhcp, the VM has address 192.168.122.4 & Mask:255.255.255.0 the VM has working outbound internet connection.
How do I correctly set dom0 to route connections for 85.25.14.195 into the VM?
Many thanks for your help and apologies if this is a basic question that has been answered before, please point me in the right direction.
First EDIT
I have managed to route the public IP by adding the below route in Dom0, DomU now correctly responds to packets received by Dom0 for the public IP forwarded over virbr0.
route add -net 85.25.14.195 gw 192.168.122.1 netmask 255.255.255.255
My follow up question is what rule is required in IP tables to allow traffic? As currently it is blocked when the firewall is running.
Second EDIT
OK, so I figured out the iptables, I had to remove the REJECT line on virbr0, I also had to add the following rule to make the outbound IP from Dom0 appear correctly:
-A POSTROUTING -s 192.168.122.2 -p tcp -j SNAT --to 85.25.14.195
You should be able to assign 85.25.14.195 as alias IP on virbr0 ( may be virbr0:1 ) and do simple IP Nat or forwarding. You need to do # sysctl -w net.ipv4.ip_forward=1 to be able to forward traffic coming on Public IP to internal Private IP.

How to forward packet from eth0 to a tun/tap device?

Here is the topo: HostA(eth0) ---- (eth0)HostB
I have created a tun/tap device on HostB, for say tun0 or tap0. When eth0 of HostB receives a packet from HostA, maybe a ICMPv6(NS, echo request, etc.) or a UDP/TCP packet(encapsulated with IPv6 header), I want to forward this packet from eth0 to tap0. After doing something to this packet, I also want to send a reply back to HostA, through tap0 and eth0.
I cannot find a way to do that, can some one help me or give some hints?
This is an extremely basic routing question, probably unsuitable for Stack Overflow.
You need something like this on Host B:
HostB# sysctl -w net.ipv6.conf.all.forwarding=1
HostB# ip -6 addr add 2001:db8:0:0::1/64 dev eth0
HostB# ip -6 addr add 2001:db8:0:1::1/64 dev tun0
Then on Host A:
HostA# ip -6 addr add 2001:db8:0:0::2/64 dev eth0
HostA# ip -6 route add default via 2001:db8:0:0::1 dev eth0
HostA# ping6 2001:db8:0:1::2 # <-- should work if that host exists on tun0

Pinging between two tap devices on the same machine

I have two virtual TAP interfaces tap0 and tap1 on my machine. They have IPs 10.0.0.1 and 10.0.0.2 respectively. They are both connected to each other using socat. Both have netmasks 255.255.255.0 (and hence are on the same subnet). With this setup, I try pinging 10.0.0.2 through tap0 and vice versa. This doesn't seem to work for some reason. Although tcpdump shows ARP packets from tap0 reaching tap1, there are no ARP replies and hence no ICMP requests and hence no ICMP replies. Using a TUN device instead of a TAP device bypasses the ARP request/response cycle, but now the ICMP requests show up at tap1 with no ICMP response coming back.
I have tried a couple of things like enabling ip_forward ( echo 1 > /proc/sys/net/ipv4/ip_forward) and disabling reverse path filtering ( echo 0 > /proc/sys/net/ipv4/conf/tap0/rp_filter and echo 0 > /proc/sys/net/ipv4/conf/tap1/rp_filter ).
Here are the commands to reproduce my problem :
sudo socat TUN:10.0.0.1/24,tun-type=tap TUN:10.0.0.2/24,tun-type=tap
sudo ifconfig tap0 10.0.0.1 netmask 255.255.255.0
sudo ifconfig tap1 10.0.0.2 netmask 255.255.255.0
ping -Itap0 10.0.0.2
tcpdump -Itap0 -n
tcpdump -Itap1 -n

Resources