Ask / Submit

Revision history [back]

click to hide/show revision 1
initial version

posted 2018-11-12 12:33:24 +0300

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable...

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now:

``` on sailfish: sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE iptables -A FORWARD -m conntrack --cstate RELATED,ESTABLISHED -j ACCEPT

on linux machine: ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3 ```

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now:

```

on sailfish:
sysctl net.ipv4.ip_forward=1

net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE iptables -A FORWARD -m conntrack --cstate RELATED,ESTABLISHED -j ACCEPT

ACCEPT

on linux machine: ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3 ```

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now:

on sailfish:
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --cstate --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now:now (replace device names for what you have):

on sailfish:
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works.

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works.works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add

nat_interface = rmnet_data0

Then it works after reboot.

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to addadd to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

sources for reference

https://git.merproject.org/mer-core/usb-moded/blob/master/src/usb_moded-network.c

https://github.com/philippedeswert/usb-moded

tl;dr

Add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat = 1
nat_interface = rmnet_data0

And select "Developer mode" when pluggin in after reboot.

Full story:

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

sources for reference

https://git.merproject.org/mer-core/usb-moded/blob/master/src/usb_moded-network.c

https://github.com/philippedeswert/usb-moded

Update: this is probably a better fix:

Match your /etc/usb-moded/dyn-modes/connection_sharing.ini with the following:

[mode]
name = connection_sharing
module = none
network = 1
network_interface = rndis0
appsync = 1

[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
softconnect_disconnect = 0
idProduct = 0A02
dhcp_server = 1
nat = 1
nat_interface=rmnet_data0

which is basically the same as in developer_mode-android.ini but with some added stuff for connection sharing. I am also trying to get this fix into the repo.

tl;dr

Add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat = 1
nat_interface = rmnet_data0

And select "Developer mode" when pluggin in after reboot.

Full story:

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

sources for reference

https://git.merproject.org/mer-core/usb-moded/blob/master/src/usb_moded-network.c

https://github.com/philippedeswert/usb-moded

Update: this is probably a better fix:

Match your /etc/usb-moded/dyn-modes/connection_sharing.ini with the following:

[mode]
name = connection_sharing
module = none
network = 1
network_interface = rndis0
appsync = 1

[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
softconnect_disconnect = 0
idProduct = 0A02
dhcp_server = 1
nat = 1
nat_interface=rmnet_data0

which is basically the same as in developer_mode-android.ini but with some added stuff for connection sharing. I am also trying to get this fix into the repo.repo. Also no need to reboot you can just do systemctl restart usb-moded after editing the file.

tl;dr

Add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat = 1
nat_interface = rmnet_data0

And select "Developer mode" when pluggin in after reboot.

Full story:

Got it working! Just enable "Developer mode" when it asks what you want after plugging in the USB cable... Nvm, that just shows the rndis0 device. Still doesn't work.

This way you can manually enable it for now (replace device names for what you have):

on sailfish:
devel-su
sysctl net.ipv4.ip_forward=1

iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i rndis0 -o rmnet_data0 -j ACCEPT

on linux machine:
ip route add default via 192.168.2.15 dev enp0s20f0u3u4u3

Ok... To fix this just add

nat = 1

to bottom of file /etc/usb-moded/dyn-modes/developer_mode-android.ini and reboot. Then it just works. ...

Ok seems it still doesn't work and you need to enable the ipv4 forwarding AND add the iptables rules still after.

But it creates the gateway automatically on the linux computer.

Final fix was to add to /etc/usb-moded/dyn-modes/developer_mode-android.ini

nat_interface = rmnet_data0

Then it works after reboot.

sources for reference

https://git.merproject.org/mer-core/usb-moded/blob/master/src/usb_moded-network.c

https://github.com/philippedeswert/usb-moded