Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.hardware > #2876
| From | Moe Trin <ibuprofin@painkiller.example.tld.invalid> |
|---|---|
| Newsgroups | comp.os.linux.hardware |
| Subject | Re: Talk to modem with USB to serial adapter: fail |
| Date | 2015-08-17 23:50 +0000 |
| Organization | Camp Swampy Motor Pool |
| Message-ID | <slrnmt4st9.72n.ibuprofin@planck.phx.az.us> (permalink) |
| References | (4 earlier) <87wpwx86lf.fsf@bogus.nodomain.nowhere> <slrnmsvnbl.8de.ibuprofin@planck.phx.az.us> <8737zjg7zz.fsf@bogus.nodomain.nowhere> <slrnmt1rle.psv.ibuprofin@planck.phx.az.us> <87io8e4ep6.fsf@bogus.nodomain.nowhere> |
On 17 Aug 2015, in the Usenet newsgroup comp.os.linux.hardware, in article
<87io8e4ep6.fsf@bogus.nodomain.nowhere>, Mike Spencer wrote:
>Moe Trin <ibuprofin@painkiller.example.tld.invalid> writes:
>>Mike Spencer wrote:
>>> I've had no trouble with routes using the laptop on my LAN, on
>>> cabled broadband at a friend's or at wifi points. But successful
>>> connection of ppp0 to my ISP's host leaves me cut off from all the
>>> net but the machine that hosts the other end of ppp.
>> Yup, there should be an error message - "pppd not replacing an
>> existing default route".
>Just so.
Almost had to be
>I don't fully understand how to make the route(8) command
>do the right thing
----------
# Version: @(#)/etc/rc.d/rc.inet1 1.01 05/27/93
# Edit for your setup.
IPADDR="192.168.1.2" # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
NETWORK="192.168.1.0" # REPLACE with YOUR network address!
BROADCAST="192.168.1.255" # REPLACE with YOUR broadcast address if you
# have one. If not, leave blank and edit
# below.
#GATEWAY="128.253.154.1" # REPLACE with YOUR gateway address!
# Uncomment these to set up your IP routing table.
/sbin/route add -net ${NETWORK} netmask ${NETMASK} eth0
#/sbin/route add default gw ${GATEWAY} netmask 0.0.0.0 metric 1
# End of rc.inet1
----------
Notice the two lines dealing with GATEWAY are commented out. Oh, wait,
you're probably not running Slackware 2.3 any more... ;-) Most distros
today use some variation of NetworkMismanager originally created by
Robert Love for SuSE, or have their own distro-specific tool (that
they're sure is better than those other distributions methods, but
that's been common for many years). If your local setup has no route
to the world, you should not declare a "GATEWAY". If the LAN does have
one, why are you mucking around... ;-) Since about linux-2.2.0 or
so, the "ifconfig" command automatically added a network route when you
brought up an Ethernet or loopback interface, so "route -n" might look
like (although the loopback may not be shown on newer kernels):
[van-allen ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 4198 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 20 lo
[van-allen ~]$
This would handle all "local" traffic. If you have a "route to the
world", it's then declared using the "/sbin/route add default" stanza.
A minor problem is lazy admins, who use the "default" as a shotgun when
adding a second or third LOCAL network (perhaps wireless, or a DMZ or
something). That should be done without using that "default" keyword.
[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 89948 eth0
192.168.2.0 192.168.1.6 255.255.255.0 UG 0 0 32165 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 388 lo
0.0.0.0 192.168.1.248 0.0.0.0 UG 0 0 2673 eth0
[example ~]$
Here, a second local net (192.168.2.0/24) is reachable through a
router at 192.168.1.6. That's obviously quite different than the route
to the world reachable through 192.168.1.248. The second route was
created with the command
/sbin/route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.6
The use of the "netmask" indicates the reachable address range (as
opposed to the "netmask 0.0.0.0" and/or "default" above). You may also
have a route looking like
169.254.0.0 0.0.0.0 255.255.0.0 U 1 0 0 eth0
which is a Apple/microsoft thing called LinkLocal (RFC3927) also called
ZeroConf, meant for situations where there is no (routable) network
configuration. This is the same concept as the IPv6 addresses in the
"fe80::" range (RFC4291).
Some people prefer to use the "ip(8)" command rather than "route(8)",
while others prefer to let the install program set up NotworkManager
and hope for the best. Others use DHCP, in which case virtually all the
details are handled in the DHCP server (which is often the router or
"modem" provided by the ISP).
Notwithstanding the disparaging comments about NetworkMismanager, it
often comes in handy on a laptop that is meant to operate at public
hotspots away from home IN ADDITION TO operating on the Ethernet LAN
at home. Being old-fashioned (and having the root password), I prefer
to do things "manually" (static Ethernet setup, and essentially DHCP
for the rare occasions when the laptops are "outside".
>I took your advice and did "route del default". And the
>laptop->adapter->modem->dialin->ppp->internet process is working. And
>the laptop still talks to my localnet as it should.
Yup. Long ago when broadband wasn't as reliable, it was fairly common
to have a dialin as a backup. People usually wanted it to be a
transparent thing, but that is easier said than done. Merely switching
the default route (from the "router" to a box with a modem) is much
simpler to do. Any existing downloads (or equal) would have to be
restarted, because the world would see you at a "new" IP address.
>> I'm old fashioned here, and use static addressing on my lan...
>Me too. And I have masquerade working and can do it that way. I just
>wanted have this dialup functionality available, too.
So you have a route to the world via the LAN, and this dialup would
be something like a backup? What I usually recommend for that is to
manually down the Ethernet (or just the default) route before running
pppd, and manually bring it back up afterwards. It _can_ be done via
the /etc/ppp/ip-{up|down}{|.local} scripts, but it's a bit of a hassle.
Old guy
Back to comp.os.linux.hardware | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-12 03:03 -0300
Re: Talk to modem with USB to serial adapter: fail Jerry Peters <jerry@example.invalid> - 2015-08-12 20:36 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-13 04:19 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-13 21:17 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-15 02:26 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 00:45 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 00:43 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 20:09 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 01:41 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-16 20:10 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-16 22:28 -0300
Re: Talk to modem with USB to serial adapter: fail Michael Black <et472@ncf.ca> - 2015-08-16 22:48 -0400
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-17 03:35 -0300
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-17 03:22 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-17 23:50 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-18 16:16 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-21 03:31 +0000
Re: Talk to modem with USB to serial adapter: fail Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-08-25 01:58 -0300
Re: Talk to modem with USB to serial adapter: fail Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-08-27 02:28 +0000
All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-03 18:53 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-04 20:00 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Richard Kettlewell <rjk@greenend.org.uk> - 2015-09-04 21:09 +0100
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-04 23:14 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Richard Kettlewell <rjk@greenend.org.uk> - 2015-09-05 10:08 +0100
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-05 18:08 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-06 01:31 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-06 19:17 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-17 01:26 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-17 05:53 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-17 04:02 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-17 18:02 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Mike Spencer <mds@bogus.nodomain.nowhere> - 2015-09-18 02:05 -0300
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-17 19:14 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2015-09-18 01:55 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-18 21:22 +0000
Re: All better now (Re: Talk to modem with USB to serial adapter: fail) Moe Trin <ibuprofin@painkiller.example.tld.invalid> - 2015-09-17 19:12 +0000
csiph-web