LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-09-2016, 10:19 PM   #1
jludeman
Member
 
Registered: Feb 2010
Posts: 44

Rep: Reputation: 0
ubuntu as router - special circumstances


I purchased an ooma under the delusion that connecting it to my desktop would be simple.

I have a 4g usb modem that connects to the internet. The isp assigns an address which changes each time I connect.

I have an onboard ethernet card that is called eth0.

I thought I could have my computer assign an address to the ooma device connected to the ethernet port.

I also thought I could share the ppp0 connection with the ethernet card.

I did this years ago with a home lan and a dialup connection although I believe all devices on the lan had static addresses.

If this is impossible I need to return the ooma device.

Please do not suggest buying additional expensive equipment. I have no budget for that.

Thanks for any help.
 
Old 03-09-2016, 10:42 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,886

Rep: Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615Reputation: 3615
I love my Ooma. Worked great even on a 2G modem connected to a router. Ooma doesn't care if the ip address changes. Almost every home setup does that.

Sooo, what you need to do is basically a form of tethering. Or what does windows call it something like internet sharing. In your case you may need to set up some firewall rules too or open ports. \

Did you use any of the common how-tos? https://www.google.com/search?q=inte...utf-8&oe=utf-8

What guide did you use?
 
Old 03-09-2016, 11:21 PM   #3
jludeman
Member
 
Registered: Feb 2010
Posts: 44

Original Poster
Rep: Reputation: 0
I did that exact search. I probably hit 10 different pages. Some were (maybe) out of date ie: ubuntu 8.1. Some had much more complex systems which made my simple task too confusing. A lot were simple ways to get a wireless sharing. I mainly just got a headache.

Three questions:

What router do you use with your 2g?

Could I just assign the eth0 network card a static address and use forwarding to share ppp0 with eth0?

If question 2 is my security compromised at all?

Thanks for the help regardless.
 
Old 03-10-2016, 02:15 AM   #4
jludeman
Member
 
Registered: Feb 2010
Posts: 44

Original Poster
Rep: Reputation: 0
still a struggle

I used the instructions on this page howto-setup-a-static-ip-address-in-ubuntu-14-04/ to set the static address for eth0.

contents of /etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.100.2
netmask 255.255.255.0
gateway 192.168.100.1
dns-nameservers 8.8.4.4 8.8.8.8


Ifconfig output:

~$ ifconfig
eth0 Link encap:Ethernet HWaddr e0:cb:4e:e0:b6:ca
inet addr:192.168.100.2 Bcast:192.168.100.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:198 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:67716 (67.7 KB) TX bytes:0 (0.0 B)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:258 errors:0 dropped:0 overruns:0 frame:0
TX packets:258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:21092 (21.0 KB) TX bytes:21092 (21.0 KB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:10.244.243.61 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:23128 errors:0 dropped:0 overruns:0 frame:0
TX packets:22870 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:18827056 (18.8 MB) TX bytes:3438394 (3.4 MB)


I used the instruction on this page http://xmodulo.com/internet-connecti...les-linux.html to make etho forward internet too and from the usb modem.

Still nothing from Ooma device. Maybe Ooma does not like my 192.168.100.2 address? Maybe Ooma want's a dns server to assign it an address?

Bad day for other reasons. I give up for now.

After reboot no internet connection. After commenting out new stuff from /etc/network/interfaces and redial 4g internet is back. Turns out that dns-nameservers 8.8.4.4 8.8.8.8 was the exact line killing my internet.

The ipsharing script:

#!/bin/bash

## Internet connection sharing script

sysctl -w net.ipv4.ip_forward=1
sysctl -p
iptables -X
iptables -F
iptables -t nat -X
iptables -t nat -F
iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

That looks scary from a security standpoint. And Ooma doe not like it either.

Come to think of it I used Firestarter back in the day. Probably ubuntu 8.1 or so. It's no longer maintained and ufw is suggested.

Another steep learning curve I fear.

This could be a hardware problem.

~$ sudo lshw -C network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: eth0
version: 03
serial: e0:cb:4e:e0:b6:ca
size: 100Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list rom ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.037.00-NAPI duplex=full latency=0 link=yes multicast=yes port=twisted pair speed=100Mbit/s
resources: irq:42 ioport:d800(size=256) memory:fafff000-faffffff memory:faff8000-faffbfff memory:fbef0000-fbefffff
*-network DISABLED
description: Ethernet interface
physical id: 1
logical name: wwan0
serial: 16:1f:fa:a6:a8:cb
capabilities: ethernet physical
configuration: broadcast=yes driver=qmi_wwan driverversion=22-Aug-2005 firmware=WWAN/QMI device link=no multicast=yes
 
Old 03-10-2016, 12:04 PM   #5
jludeman
Member
 
Registered: Feb 2010
Posts: 44

Original Poster
Rep: Reputation: 0
some progress - still need help - what is wwan0

I remembered something about default routes. I did a little more google searching.

Using this site i discovered an error in iptables.

Code:
# next four lines wrong should look like four following lines - specifically forward to eth0 address
# iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -I FORWARD  -m state --state RELATED,ESTABLISHED -j ACCEPT
# iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE
# iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
sudo iptables -A FORWARD -o ppp0 -i eth0 -s ??.??.??.??/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
I also discovered an error in /etc/network/interfaces:
Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# eth0
iface eth0 inet static
address ??.??.??.??
netmask 255.255.255.0
gateway ??.??.??.??
# wrong should be in /etc/resolv.conf
#google public services
#dns-nameservers 8.8.4.4 8.8.8.8
That leaves establishing a route.

route add -net ??.??.??.?? netmask 255.0.0.0 gw ??.??.??.??
sudo route del default gw ??.??.??.??
sudo route add default gw ??.??.??.??

The ??.??.??.?? numbers I realize are arbitrary subnet addresses. I just don't know best practice for deciding them.

If ooma really does not care what address it uses to connect to the internet the above should work after deciding on a subnet address.

I also noticed that the output of ~$ ifconfig -a has changed to:
Code:
eth0      Link encap:Ethernet  HWaddr e0:cb:4e:e0:b6:ca  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:42 

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:258 errors:0 dropped:0 overruns:0 frame:0
          TX packets:258 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:21092 (21.0 KB)  TX bytes:21092 (21.0 KB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.152.12.23  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:3506 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3513 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:2920317 (2.9 MB)  TX bytes:336793 (336.7 KB)

wwan0     Link encap:Ethernet  HWaddr 00:a0:c6:00:00:00  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
This leaves me confused as to using wwan0 or eth0 as the interface in iptables. Actually I'm confused as to what wwan0 even is or why it exists.

I unplugged the usb modem and wwan0 and ppp0 disappeared. So wwan0 is Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard. ppp0 is of course my connection to the internet.

I'd appreciate some help filling in the question marks.
 
Old 03-10-2016, 10:01 PM   #6
jludeman
Member
 
Registered: Feb 2010
Posts: 44

Original Poster
Rep: Reputation: 0
Angry fini

I can't mark this as solved because it is not. I don't think it was a linux problem. I used a post on the ooma forum to try to connect in windows using sharing. It should have worked and did not.

This may have been a defective device. I was not at all impressed with customer service. So I'll be moving on.

I (re)learned a lot about linux networking in the process so it's not a dead loss.

No more ooma for me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to use rootsh under all circumstances EricTRA Linux - Server 11 01-19-2021 03:17 PM
How to send e-mail from cron only in special circumstances memorum Linux - Newbie 2 09-22-2014 10:26 AM
I have a Compiz flicker issue under certain circumstances. in_texas_dallas Linux - Software 9 10-03-2009 06:41 PM
Fedora 8 will only boot under certain circumstances Coppersworth Linux - Newbie 1 04-10-2008 09:58 PM
Scripts for certain circumstances cwwilson721 Slackware 4 03-06-2006 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration