SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well, i have a lot of linux distributions on my system, and i want to write a script which will setup my internet connection over wirelles.. here is the script:
route add default gw mango-gw
adds a default route (which will be used if no other route
matches). All packets using this route will be gatewayed
through "mango-gw". The device which will actually be used for
that route depends on how we can reach "mango-gw" - the static
route to "mango-gw" will have to be set up before.
Everything is in the 'man route', 'man' is your friend.
Code:
~#route add default gw 192.168.0.1 # change to your IP
Code:
~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 1 0 0 eth0
BTW, it's 'wireless'.
Last edited by onebuck; 05-11-2008 at 04:16 PM.
Reason: wireless
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
i have red man but it won't :P
You should read the 'man route';
Quote:
~# man route
excerpt from 'man route'
DESCRIPTION
Route manipulates the kernel's IP routing tables. Its primary use is
to set up static routes to specific hosts or networks via an interface
after it has been configured with the ifconfig(8) program.
When the add or del options are used, route modifies the routing
tables. Without these options, route displays the current contents of
the routing tables.
OPTIONS
-A family
use the specified address family (eg `inet'; use `route --help'
for a full list).
-F operate on the kernel's FIB (Forwarding Information Base) rout-
ing table. This is the default.
-C operate on the kernel's routing cache.
-v select verbose operation.
-n show numerical addresses instead of trying to determine symbolic
host names. This is useful if you are trying to determine why
the route to your nameserver has vanished.
-e use netstat(8)-format for displaying the routing table. -ee
will generate a very long line with all parameters from the
routing table.
del delete a route.
add add a new route.
For a add or del;
Code:
route add default gw 192.168.0.1
route del default gw 192.168.0.1
Edit: I would suggest that you use the DNS provided by your ISP. You can add a third level as a fall back.
Code:
4.2.2.1 #Verizon third level DNS
4.2.2.2
4.2.2.3
4.2.2.4
Just ad these or at least one of them as another DNS in your '/etc/resolv.conf' file. Place them below other DNS if you want the top level DNS to be addressed first.
Last edited by onebuck; 05-14-2008 at 12:01 PM.
Reason: resolv suggestions.
Please, forget about ifconfig and route, use iproute2(/sbin/ip). By the way it's syntax is much more handy.
You do as you wish but I will continue with route and ifconfig. I do use IP but most newbies don't. I'm comfortable with using the basic command sets with a newbie.
The syntax is not really handy but semantically easier once you use it and search through the reference(s).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.