1

I had problem after I bought huawei E3372, because I tried to connect it with my openWRT based router and openWRT didn't support it in standard. I tried to install vendor drivers but on my primitive router there wasn't enough space to install them. So I was thinking about scenario to forward internet from my laptop by eth0 interface to my router (to connect openWRT to internet and made operation in internet (share file, mount file disc etc) On My Laptop modem works and I have internet access

So my question is how to achieve this connection:

 MobileModeb(USB saw as wired connection) -> Laptop ->(ethernet cable) -> Linux Router

Is this bridge or IP forwarding? Or something different?

I'm sorry but I am noob in internet administration issues.

2

It's IP forwarding, you can implement that with a couple of commands:

In the file /etc/sysctl.conf, add or uncomment the following line using your preferred text editor (vim, gedit, etc):

net.ipv4.ip_forward = 1

To enable the changes in sysctl.conf you need to run the command:

sudo sysctl -p /etc/sysctl.conf

You may also want to configure IPTables with the commands:

sudo iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

sudo iptables -A FORWARD -i eth1 -o eth0 -m state -–state RELATED,ESTABLISHED -j ACCEPT

sudo iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

Substitute eth1 by your internet interface (the modem, as called in your system) and substitute eth0 by the interface connected to the router (probably it's really eth0).

To make it permanent, run:

sudo iptables-save > /etc/iptables.rules

Try that and report back any problems.

| improve this answer | |
  • after type Your command everything pass but when I connect second laptop by ethernet cable i didn't have internet connection or even ip address. The same is with my router I didn't have internet access – Mazeryt Jan 23 '15 at 22:54
  • Have you connected the first Laptop (with the Modem) to the "WAN" port of your router? You should do so and, on the router, configure the WAN port to fixed IP address and give it an address in the same network of the cable port of the first notebook (eg. 192.168.10.1 for laptop and 192.168.10.2 for router, netmask 255.255.255.0), and also set the default gateway in the router to laptop IP, if available. – diegov Jan 25 '15 at 0:32
  • My ruter, and in example other laptop didn't get IP-address after calbe connection inside port I dont know maybe dhcp addresses didn't work fine for me – Mazeryt Feb 4 '15 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.