One IP address when wifi and ethernet connected

OK. To make sure my files weren’t fudged somehow I’ve reinstalled OSMC alpha 4 on the Pi 2.

I was surprised to discover that under /etc/network there wasn’t any interfaces file. I have the router to manually allocate an ip address to the pi wifi (EW-7811n) so perhaps that’s why I can get ssh via wifi with ease. Also, ir raises questions as to whether the interfaces file in /etc/network actually does anything. Allocating a static IP for eth0 doesn’t work, I have to do it manually all the time.

I also notices that iptables command wasn’t installed, had to install it manually. Does the pre-up iptables command also requires some sort of installation?

The ip addr command also had to be manually installed. So it seems that there are a few commands that need manually installation. I may be missing some to get it all to work or perhaps /etc/network/interfaces file doesn’t do anything.

Regarding your outputs, sysctl returns net.ipv4.ip_forward = 1. From the pi, ping 192.168.2.2 and ping 192.168.15.1 both work fine there’s no packet loss. TV has a manual IP set for ethernet so in theory it should work.

netstat -rn output

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.15.1    0.0.0.0         UG        0 0          0 wlan0
192.168.2.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
192.168.15.0    0.0.0.0         255.255.255.0   U         0 0          0 wlan0
192.168.15.1    0.0.0.0         255.255.255.255 UH        0 0          0 wlan0

iptables -v -L output

Chain INPUT (policy ACCEPT 366 packets, 36259 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  eth0   wlan0   anywhere             anywhere            
    0     0 ACCEPT     all  --  wlan0  eth0    anywhere             anywhere             state RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 220 packets, 25304 bytes)
 pkts bytes target     prot opt in     out     source               destination 

iptables -t nat -v -L output

Chain PREROUTING (policy ACCEPT 9 packets, 2048 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain INPUT (policy ACCEPT 9 packets, 2048 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 50 packets, 4245 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 9 packets, 524 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  110  9004 SNAT       all  --  any    wlan0   anywhere             anywhere             to:192.168.15.6
    0     0 SNAT       all  --  any    wlan0   anywhere             anywhere             to:192.168.15.6

The eth0 tcpdump on the pi and ping from laptop returns

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel

However, other times it returned

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C20:15:58.071481 IP Brunos-MacBook-Pro.local > osmc.local: ICMP host 192.168.2.11 unreachable, length 36

1 packet captured
2 packets received by filter
1 packet dropped by kernel

The wlan0 tcpdump returns

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
1 packet dropped by interface

On all occasions I have to halt the tcpdump on the pi with ctrl+C.

So, overall perhaps interfaces file doesn’t do anything. I have to setup eth0 IP address and iptables manually after rebooting. Somehow the routing is perhaps controlled by another file/command which I’m not sure about or maybe I’m missing some commands which are not included in the default OSMC installation.