Hi all
In the end we’ve got it working. Following the missing steps from ConnMan.
Supposing the WiFi is online and ETH is ready
connmanctl> services
*AO eamob wifi_0024d76e6c38_65616d6f62_managed_psk
*AR Wired ethernet_68b599eda216_cable
$ /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 68:b5:99:ed:a2:16
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::6ab5:99ff:feed:a216/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:131 errors:0 dropped:0 overruns:0 frame:0
TX packets:115 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25035 (25.0 KB) TX bytes:14956 (14.9 KB)
Interrupt:20 Memory:d7500000-d7520000
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:527 errors:0 dropped:0 overruns:0 frame:0
TX packets:527 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:47689 (47.6 KB) TX bytes:47689 (47.6 KB)
wlan0 Link encap:Ethernet HWaddr 00:24:d7:6e:6c:38
inet addr:192.168.43.26 Bcast:192.168.43.255 Mask:255.255.255.0
inet6 addr: fe80::224:d7ff:fe6e:6c38/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:60 errors:0 dropped:0 overruns:0 frame:0
TX packets:125 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6901 (6.9 KB) TX bytes:17294 (17.2 KB)
The routing table, as correctly pointed out by David are not populated
correctly.
root@ale:/home/alessandra# ip route show table 256 (empty)
root@ale:/home/alessandra# ip route show table 257
default via 192.168.43.1 dev wlan0
Adding than the following:
root@ale:/# ip route add default via 192.168.1.1 table 256
root@ale:/# echo 1 > /proc/sys/net/ipv4/ip_forward
root@ale:/# for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 0 > $f ; done
root@ale:/# echo 0 > /proc/sys/net/ipv4/route/flush
and especially the following two lines:
root@ale:/# iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source
192.168.1.100
root@ale:/# iptables -t nat -A POSTROUTING -o wlan0 -j SNAT --to-source
192.168.43.26
I’ve got now:
wifisession@:~$ curl ifconfig.me
5.170.189.246 (wifi)
ethsession@:~$ curl ifconfig.me
80.21.33.250 (eth)
i.e.: the routing is correctly done discriminating UID.
> On 03 Jul 2015, at 15:41, Daniel Wagner <[email protected]> wrote:
>
> On 07/03/2015 03:18 PM, Gianfranco Casanova wrote:
>> ————————————————————————————
>> root@ale:/var/log# ip rule show
>> 0: from all lookup local
>> 32764: from all fwmark 0x101 lookup 257
>> 32765: from all fwmark 0x100 lookup 256
>> 32766: from all lookup main
>> 32767: from all lookup default
>> ————————————————————————————
>>
>> ————————————————————————————
>> root@ale:/var/log# ip route show table 0x101
>> ————————————————————————————
>
> So this is wrong. We should have a default routing entry for the wifi
> policy routing table. Without a match, the main/default routing table
> will be used.
>
> For testing just add the missing route entry to table 0x101, e.g.
>
> # ip route add default via 172.20.10.1 dev wlan0 table 0x101
>
>
>> from /var/log/kern.log I can see that the packages are correctly marked.
>
> That is good news. So I think it the missing routing entry should do the
> trick.
>
> cheers,
> daniel
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman