Solved

adding a route to the default gateway

Posted on 2002-05-24
8
224 Views
Last Modified: 2013-12-16
Hi,

I have Redhat 7.3 installed and I'm using KPPP to dial up my ISP.  The ISP uses dynamic IP and so I get a new IP address when I connect.

The problem is opera/mail etc can't communicate with the internet until I open a console and type

route add default gw <ipaddress>

where ipaddress is the one given to me by the ISP.

I'm obviously doing something wrong.

Can anyone tell me how to set this up so it all happens automatically and correctly.

Thanks,
Mike.
0
Comment
Question by:MDarling
  • 4
  • 3
8 Comments
 

Expert Comment

by:rprakasan
ID: 7031759
Are u using any proxy settings on this. Then I suggest set the manual proxy setting in the Opera browser.
0
 
LVL 3

Author Comment

by:MDarling
ID: 7031793
no proxy settings - just a straight workstation connecting to the web.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7032974
enable following in /etc/ppp/options

defaultroute

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 3

Author Comment

by:MDarling
ID: 7033398
Hi ahoffman,

I tried this without success.

I tried adding it to the pppd arguments in the KPPP connection and I also tried editing /etc/ppp/options and adding it in there.

Neither seems to work, am I doing something wrong?

Regards,
Mike.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7034179
please post /etc/ppp/options
You also may have n options.* file there for your named connection, check it too.
And there should be a ip-up script, it should contain something like:

    /sbin/route add default gw $REMOTEIP dev $INTERFACE
0
 
LVL 3

Author Comment

by:MDarling
ID: 7035831
Hi ahoffman

/etc/ppp/options

>>>>
lock
defaultroute
<<<<

/etc/ppp/ip-up

>>>>
#!/bin/bash

# This file should not be modified -- make local changes to
# /etc/ppp/ip-up.local instead

LOGDEVICE=$6
REALDEVICE=$1

export PATH=/sbin:/usr/sbin:/bin:/usr/bin

[ -f /etc/sysconfig/network-scripts/ifcfg-${LOGDEVICE} ] && /etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}

[ -x /etc/ppp/ip-up.local ] && /etc/ppp/ip-up.local "$@"

exit 0
<<<<


I don't have an ip-up.local.

Regards,
Mike.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 7036690
ip-up does not setup the required route, try with following:

  INTERFACE=$1
  REMOTEIP=$5
  /sbin/route add default gw $REMOTEIP dev $INTERFACE
0
 
LVL 3

Author Comment

by:MDarling
ID: 7037739
Hi ahoffman,

Thanks for your help, your solution worked with the exception I needed to use REMOTEIP=$4 rather than $5.

Thanks, a lot.
Regards,
Mike.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Guacamole cut and paste issue 3 74
AWS - HAProxy- KeepAlived 5 43
expectj telnet failing 5 36
Run same command on multiple files in Linux 3 32
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question