Hi

[html formated mails are almost certainly blocked on this mailing list]

On 07/03/2015 04:29 PM, Gianfranco Casanova wrote:
> Hi all
> 
> In the end we’ve got it working. Following the missing steps from ConnMan.

Nice to hear.

> 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*

Are the last 3 commands necessary? I am surprised local generated
packets travel through the nat table.

> 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
> *

So it is necessary to change the source IP address in the NAT table. I
wonder why this isn't happening with the policy routing table entry?

> I’ve got now:
> wifisession@:~$ *curl ifconfig.me <http://ifconfig.me>*
> 5.170.189.246(wifi)
> 
> ethsession@:~$ *curl **ifconfig.me <http://ifconfig.me>** *
> 80.21.33.250(eth)
> 
> i.e.: the routing is correctly done discriminating UID.

Cool, so at least we are on the right track here.

cheer,
daniel
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to