Originally Posted by sahil.jammu
While disucssing with my friend on basic internals on linux, we came across a scenario where:-
1. The phone(Linux) is connected to the PC(windows) , the phone is getting packets from Network and has to act like an router to redirect the packets to PC.
so its like:-
Network - - Sending packets to Phone(running on android) - -> Phone is connected to PC (usb connection) The network will assign an IP adress to the phone for the continuos packet transfer, and there will be one IP adress of phone for the USB service.
so we can say instead of giving 1 IP address, we will be giving the IP address to the service itself.
Now what should be the best way for Phone to act like an router.
End goal is the packets which are coming from Network should reach PC.
(I assume there will be dedicated ports for the transfer)
YOur comments plz....
I agree with alli_yas...bumping your own thread (and cross-posting/duplicating), is pretty rude. Also, spell out your words.
And you don't give an IP address to a service, ever. You assign IP's to DEVICES. And you need to read up on what routing is, and how it works. If you want to route packets between two devices, they BOTH need addresses, with gateways, etc. If you have one address, that's very much like having one walkie-talkie....no one is on the other end to receive what you're sending.
You COULD write a custom module to use the phone as an IP device via USB serial...but as alli_yas said, you're far better off using it as a dial-up device, and using one of the built-in DUN tools (like wvdialconf), to establish a connection.