SCIENTIFIC-LINUX-USERS Archives

December 2013

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
ToddAndMargo <[log in to unmask]>
Reply To:
ToddAndMargo <[log in to unmask]>
Date:
Wed, 4 Dec 2013 13:14:37 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (75 lines)
> On Wed, Dec 4, 2013 at 2:41 PM, ToddAndMargo <[log in to unmask]> wrote:
>> Hi All,
>>
>> SL 6.5, 64 bit.
>>
>> I had to manually configure a Tread Net TEW-638PAP as a wireless
>> bridge yesterday.  In the process, I had to change my default
>> router (a.k.a. gateway) three times.  (Networking too, but
>> that worked.) The TEW-638PAP was hooked to my second
>> Ethernet port (eth1).
>>
>> Problem, I had to reboot to get the new default route to
>> stick.
>>
>> Now I know of two places I can put my default router:
>>
>>     /etc/sysconfig/network     <--- where I put it
>>     GATEWAY=192.168.10.100   and
>>
>>     /etc/sysconfig/network-scripts/ifcfg-eth1
>>     GATEWAY=192.168.10.100
>>
>> I am using /etc/sysconfig/network and the "vi" method.
>>
>> To check my default router setting, I used "netstat -rn"
>> and looked for the tags "UG".  (It is at the bottom of
>> the list.)
>>
>> To try to get the new default router setting to take,
>> I used:
>>
>>      service network restart; netstat -rn
>> and
>>      ifdown eth1; ifup eth1; netstat -rn
>>
>> No joy with either method.  Whatever gateway I had when
>> I booted, was the one I was stuck with.  Reboot
>> was the only way to make the change.  I even tried
>> manually configuring it with "route".  No joy there
>> either.  :'(
>>
>> What did I do wrong?
>>
>> Many thanks,
>> -T


On 12/04/2013 12:20 PM, Paul Robert Marino wrote:
> ip route delete default via xxx.xxx.xxx.xxx dev eth0
> then
> ip route add default via yyy.yyy.yyy.yyy dev eth0
>
> replace xxx.xxx.xxx.xxx with your current router and yyy.yyy.yyy.yyy
> with the new one
>
> there is also an "ip route replace " syntax as well if you need it
> see "man ip" for more details ;-)


Hi Paul,

Worked beautifully.  Thank you!
Any idea why restarting the network service did not catch
my change to /etc/sysconfig/network?

And, should I be setting my router in /etc/sysconfig/network
or /etc/sysconfig/network/scripts/ifcfg-eth1?

-T

Fun command line:

$ ip route | grep -i default | awk '{print $3}'
192.168.240.1

ATOM RSS1 RSS2