In article <L0xld.21138$(E-Mail Removed) >, Al. C wrote:
>It seems (for me anyway) that "ifconfig eth0 down" deletes the default gateway
>from route table. (And it makes sense if the gateway is the ethernet card...
>so if it goes down, Linux is correct in erasing an entry from the route table
>(if there is such an animal.)
Correct - you have no means of reaching the gateway, so the entry should
be deleted.
>http://tinyurl.com/3kgm9
Sorry - don't use those, but I can sorta guess what it might be telling
>route add default gw 129.168.1.1
>
>brings back network functionality after an "ifconfig eth0 up" command. The
>web page cited above uses a different command and the man route page is
>cryptic as hell, but after trying to put the man page together with the above
>web page, I think I figured it out.
[compton ~]$ whatis ifconfig route
ifconfig (8) - configure a network interface
route (8) - show / manipulate the IP routing table
[compton ~]$
The purpose of the 'ifconfig' command is to bring the interface up and
down, setting parameters DIRECTLY related to the interface (IP address,
network address, broadcast, MTU, hardware address, etc.). Starting with
either the 2.0.0 or 2.2.0 kernel (can't remember which), _Linux_ added
the function that bringing up an interface also added a network route
for the configured interface/network. This _HAD_ been done as a separate
command before.
The purpose of the 'route' command is to add/subtract routes that use
the existing networking setup. Traditionally, you ran the ifconfig to
bring up the interface, then ran the route command to add routes - first
being a network address, and then OPTIONALLY, you would add routes to
other networks, using hosts on the local network as gateway routers. The
first route command has now been combined with the 'ifconfig up' function,
but the optional second command can't be combined, because no one knows
what routes you might have, or the IP address of those gateways. So,
you have to add those extra routes as a separate step.
>Which comes down to this. For me, if I want to use the modem AND I'm
>connected to the router at boot time, I need to do the "ifconfig eth0
>down" command and then dial out.
OK, I'll ignore the security aspects of this one. Your problem is with
the pppd daemon. Starting with ppp-2.3.6, the behavior changed such that
if you have a PRE-EXISTING default route on your computer, pppd will
assume that you are an ISP, _AND_ that who ever you are connecting to
will have to authenticate to you. The way around that is the 'noauth'
option to pppd. There is a SECOND PROBLEM with this if you are trying
to use the 'defaultroute' option to pppd when you already have a pre-
existing default route. pppd will not _replace_ a default route (although
some of the "helper programs" can force this - but who cares about
security). Look at the programming definition of a 'default' - it's what
you use when nothing else fits. That matches the meaning of the default
route - it's the route you use when nothing else is defined. So, if you
have two defaults, which do you use? Flip a coin?
>I really thought there was a way to be online with DSL and the modem at the
>same time, but I guess not. (Why would you want to do this? Some people still
>have dial-up to their bank to send credit card sales txns.)
Likely, you need the 'noauth' option to pppd, but the routing thing may also
be a problem. When you dial in, are there computers BEYOND the one at the
other end of the telephone line that you are accessing using the peer as
a gateway? If 'no' then don't include the 'defaultroute' option to pppd.
If yes, the "correct" solution is to add a specific network route in the
/etc/ppp/ip-up (or ip-up.local if your distribution wants you to use that)
such as
/sbin/route add -net 123.45.67.0 netmask 255.255.255.0 -gw $5 $1
and delete the route in /etc/ppp/ip-down (or ip-down.local). The ip-up
is run when the ppp interface goes up for IP, with $1 being the
interface name, and $5 being the IP of the peer. See the pppd man page,
looking under section "SCRIPTS" for more details. Oh, and to find
out if you need the network route or not, just run tcpdump on the
existing dialin connection, and see who your system is talking to.
There is another alternative, and that's to use the noauth option, and
in ip-up first run a route command to delete the _existing_ default,
and add a new default manually.
/sbin/route del default
/sbin/route add default -gw $5 $1
and in ip-down, reverse this action. You'd need to know the gateway
address on the Ethernet link, as Linux has no way of guessing what it might
be. Not knowing what your local network setup might be, and what is in
your network scripts, I don't know why your _LATER_ use of 'intet1 restart'
doesn't work. It _might_ be a firewall issue.
Old guy