DougieLawson wrote:Post the contents of /etc/network/interfaces and /etc/dhcpcd.conf
Hmmm!SurferTim wrote:In addition to DougieLawson's requests, post the contents of /etc/dhcpcd.conf.
Biter bitten.DougieLawson wrote:DougieLawson wrote:Post the contents of /etc/network/interfaces and /etc/dhcpcd.confHmmm!SurferTim wrote:In addition to DougieLawson's requests, post the contents of /etc/dhcpcd.conf.
DougieLawson wrote:Post the contents of /etc/network/interfaces and /etc/dhcpcd.conf
Post the results from running
ifconfig -a
ip route
sudo ping -c3 $(ip route | awk '/default/ {print $3}')
sudo ping -c3 8.8.8.8
sudo ping -c3 google.com
cat /etc/resolv.conf
Code: Select all
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
hostname
# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
#duid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
interface eth0
static ip_address=192.168.137.151/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1 8.8.8.8
Code: Select all
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
eth0 Link encap:Ethernet HWaddr b8:27:eb:6a:7a:e4
inet addr:192.168.137.151 Bcast:192.168.137.255 Mask:255.255.255.0
inet6 addr: fe80::d3c9:12a9:4de4:9315/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1372 errors:0 dropped:0 overruns:0 frame:0
TX packets:4194 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:88337 (86.2 KiB) TX bytes:5383135 (5.1 MiB)
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:175 errors:0 dropped:0 overruns:0 frame:0
TX packets:175 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:14218 (13.8 KiB) TX bytes:14218 (13.8 KiB)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:3f:2f:b1
inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::f2ab:4f3a:9a11:9fb0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:191 errors:0 dropped:33 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32931 (32.1 KiB) TX bytes:9922 (9.6 KiB)
Code: Select all
default via 192.168.1.1 dev eth0 metric 202
default via 192.168.1.1 dev wlan0 metric 303
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.6 metric 303
192.168.1.1 dev eth0 scope link metric 202
192.168.137.0/24 dev eth0 proto kernel scope link src 192.168.137.151 metric 202 Code: Select all
PING 192.168.1.1 (192.168.1.1) 56(124) bytes of data.
From 192.168.137.151 icmp_seq=1 Destination Host Unreachable
From 192.168.137.151 icmp_seq=2 Destination Host Unreachable
From 192.168.137.151 icmp_seq=3 Destination Host Unreachable
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2007ms
pipe 3
Code: Select all
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.137.151 icmp_seq=1 Destination Host Unreachable
From 192.168.137.151 icmp_seq=2 Destination Host Unreachable
From 192.168.137.151 icmp_seq=3 Destination Host Unreachable
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2000ms
pipe 3
Code: Select all
# Generated by resolvconf
nameserver 192.168.1.1
nameserver 8.8.8.8
There is an error in the configuration above.goktugk97 wrote:Code: Select all
interface eth0 static ip_address=192.168.137.151/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 8.8.8.8
What does your network use?.goktugk97 wrote:I changed the ip 1.151 from 137.151 now I can't connect either way
Raspbian does it the same way that every other Linux system does it. The route with the lower metric is the preferred route.Ernst wrote:Advanced note on 3). I do not know how raspbian internally routes ethernet traffic and for this reason it is a general rule.
that is not what I meant - the question is, when there are multiple interfaces with an address in the same subnet, how does linux route the reply to a packet where the request arrived on an interface with a higher metric. Is the reply send using the incoming interface or is the reply routed to an interface with the lowest metric ?DougieLawson wrote:Raspbian does it the same way that every other Linux system does it. The route with the lower metric is the preferred route.Ernst wrote:Advanced note on 3). I do not know how raspbian internally routes ethernet traffic and for this reason it is a general rule.
If have done some more testing and I have been able to confirm my suspicions. We do not have any information on the network configuration except that there is an ethernet cable with link status up and a static address, a wireless connection with a static address. If both interfaces have been assigned an IP-address in the same subnet then the ethernet interface will have a lower metric. If a remote clients sends a request to the registered address of the host, and this address is the one configured on the wlan interface, then the reply will be routed on the ethernet interface.Ernst wrote:that is not what I meant - the question is, when there are multiple interfaces with an address in the same subnet, how does linux route the reply to a packet where the request arrived on an interface with a higher metric. Is the reply send using the incoming interface or is the reply routed to an interface with the lowest metric ?DougieLawson wrote:Raspbian does it the same way that every other Linux system does it. The route with the lower metric is the preferred route.Ernst wrote:Advanced note on 3). I do not know how raspbian internally routes ethernet traffic and for this reason it is a general rule.
If might be worthwhile to read the original post because a lot of important information has been omitted by the previous quoter (TL;DR?)3) As a general rule you should not have more then one active interface (ethx,wlanx) with an address in the same subnet to avoid problems with routing. It is advisable to disable the WiFi when working with an ethernet cable.
If it does not work then start from the beginning and look where the problem could be.goktugk97 wrote:I tried it again.Now it doesn't work completely.
I think internet is up. But connecting to raspberry is very difficult.I use putty to connect but now it is connecting randomly.It asks me for login prompt random times.After connecting raspberry It gives " Network error:Software caused connection abort " error after short time.But in the time when I could enter something I entered ifconfig it gave this.With my little knowledge I think internet is working.Ernst wrote:If it does not work then start from the beginning and look where the problem could be.goktugk97 wrote:I tried it again.Now it doesn't work completely.
I suggest that you make a drawing of your network with all the compontents, cables and IP-addresses.
Code: Select all
eth0 Link encap:Ethernet HWaddr b8:27:eb:6a:7a:e4
inet addr:192.168.137.151 Bcast:192.168.137.255 Mask:255.255.255.0
inet6 addr: fe80::d3c9:12a9:4de4:9315/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:828 errors:0 dropped:0 overruns:0 frame:0
TX packets:273 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:90313 (88.1 KiB) TX bytes:41786 (40.8 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:357 errors:0 dropped:0 overruns:0 frame:0
TX packets:357 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:29828 (29.1 KiB) TX bytes:29828 (29.1 KiB)
Code: Select all
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.137.151 icmp_seq=1 Destination Host Unreachable
From 192.168.137.151 icmp_seq=2 Destination Host Unreachable
From 192.168.137.151 icmp_seq=3 Destination Host Unreachable
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2003ms
pipe 3Please stop testing the internet, you might be able to break it.goktugk97 wrote:Nope it doesn't working
Code: Select all
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. From 192.168.137.151 icmp_seq=1 Destination Host Unreachable From 192.168.137.151 icmp_seq=2 Destination Host Unreachable From 192.168.137.151 icmp_seq=3 Destination Host Unreachable --- 8.8.8.8 ping statistics --- 3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2003ms pipe 3
Ernst wrote:It is very difficult to analyze a problem when not all information is available.
The first thing you should do is make a drawing with all components, cables and IP-addresses.
From where did you get the IP-address configured on eth0 ? Is this a static address or did it come from a DHCP server ? Do you have any other device with the same IP-address ? What is on the other end of the ethernet cable ? Which components are there between the Pi and the internet router ? What is your access point, is it in your internet router ? Where is your DCHP server ? What is your DHCP server configuration ? Do you have a switch with a good quality cable to an access point ? ......
What power supply are you using for the Pi ? Are you using a good quality power cable ?
DougieLawson wrote:On your laptop do the following
[WIN key]+[R]
cmd [ENTER]
ipconfig /all [ENTER]
[CTRL]+[M]
[CTRL]+[A]
[ENTER]
Paste the results of doing that on here.
Code: Select all
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Tüm hakları saklıdır.
C:\Users\goktu_000>ipconfig /all
Windows IP Configuration
Host Name . . . . . . . . . . . . : Goktug
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
Physical Address. . . . . . . . . : 0A-00-27-00-00-0D
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::7ce3:38b0:88a3:c002%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 738852903
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1C-FF-68-92-14-DD-A9-05-E1-5E
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
Wireless LAN adapter Local Area Connection* 9:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Wi-Fi Direct Virtual Adapter
Physical Address. . . . . . . . . : 2A-C2-DD-1B-34-7B
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Ethernet 2:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Windows Adapter V9
Physical Address. . . . . . . . . : 00-FF-2A-06-28-4F
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
Physical Address. . . . . . . . . : 14-DD-A9-05-E1-5E
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::306b:ecd:a3dc:da8a%4(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.137.1(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
DHCPv6 IAID . . . . . . . . . . . : 336911785
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1C-FF-68-92-14-DD-A9-05-E1-5E
DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Ethernet 3:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Windows Adapter V9 #2
Physical Address. . . . . . . . . : 00-FF-36-7B-3D-07
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Ethernet adapter Ethernet 4:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : TAP-Windows Adapter V9 #3
Physical Address. . . . . . . . . : 00-FF-8B-D6-23-BA
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Realtek 8821AE Wireless LAN 802.11ac PCI-E NIC
Physical Address. . . . . . . . . : 28-C2-DD-1B-34-7B
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::c940:1435:2784:64a%19(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.5(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : 13 Şubat 2017 Pazartesi 18:56:18
Lease Expires . . . . . . . . . . : 14 Şubat 2017 Salı 18:56:18
Default Gateway . . . . . . . . . : fe80::16cc:20ff:fea8:8b61%19
192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 354992861
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1C-FF-68-92-14-DD-A9-05-E1-5E
DNS Servers . . . . . . . . . . . : 192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled
Tunnel adapter Local Area Connection* 11:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft Teredo Tunneling Adapter
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{A44A2479-433C-495D-A479-A51FD9107BD3}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{08195E0B-56DD-4D5E-916F-54662783F9B1}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #4
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
Tunnel adapter isatap.{7E1AE611-AD25-40D6-A350-590B694CD555}:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5
Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
C:\Users\goktu_000>