LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-26-2004, 05:39 PM   #1
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Rep: Reputation: 30
setting my router as the default gateway


my router's address is 192.168.0.1 and i would like to set it to be the gateway to the internet (since it will also act as my firewall)

how can i determine if this is already done or how would i set this option?

*does it have anything to do with the "broadcast address" and if not, what is the broadcast address?
 
Old 03-26-2004, 05:44 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
edit /etc/resolv.conf

nameserver 192.168.0.1

good luck.
 
Old 03-26-2004, 05:52 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Quote:
Originally posted by PEACEDOG
edit /etc/resolv.conf

nameserver 192.168.0.1

good luck.
That's for DNS. Add your ISP's DNS servers in that file, not gateway.

To set as your gateway, simply do this at a terminal as root or console:

route add default gw 192.168.0.1

If you tell us what specific distro you are doing this in, I'm sure someone will be able to tell you how to add it permanently so it gets set each time.
 
Old 03-26-2004, 05:53 PM   #4
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Original Poster
Rep: Reputation: 30
it seems that file is modified at each bootup (and it currently lists my isp's dns servers)...

how can i stop the system from modifying the file at bootup? (i use dhcpcd)
 
Old 03-26-2004, 05:55 PM   #5
borodimer
LQ Newbie
 
Registered: Nov 2003
Posts: 13

Rep: Reputation: 0
Well, here is what your information would (probably) be for your ip:
address 192.168.0.x (x is the last octet of your ip)
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1

These settings go in a variety of different places on different linux distros. If you post which one you need help with ...
 
Old 03-26-2004, 05:56 PM   #6
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
sorry didn't mean to give bogus info, rechecked my system and, the proper file is /etc/rc.d/rc.inet1.conf. there is a line in the file

# Default gateway IP address:
GATEWAY="192.168.0.1"

should've checked that before posting, sometimes i think before i answer, sometimes i answer before i think. again my apologies.

Last edited by Peacedog; 03-26-2004 at 06:12 PM.
 
Old 03-26-2004, 06:46 PM   #7
syberdave
LQ Newbie
 
Registered: Oct 2003
Distribution: slackware
Posts: 13

Rep: Reputation: 0
Quote:
Originally posted by PEACEDOG
sorry didn't mean to give bogus info, rechecked my system and, the proper file is /etc/rc.d/rc.inet1.conf. there is a line in the file

# Default gateway IP address:
GATEWAY="192.168.0.1"

should've checked that before posting, sometimes i think before i answer, sometimes i answer before i think. again my apologies.
the way specified is for slackware...
if you don't use slackware, you need to tell us what distribution you use.
it's different for every distribution.
 
Old 03-26-2004, 06:55 PM   #8
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Quote:
the way specified is for slackware...
if you don't use slackware, you need to tell us what distribution you use.
it's different for every distribution.
you are correct, the information i posted is for slackware. you are also correct that every distro is different, as i have only used a few it would be impossible to post the correct answer for all distros. if you would like to help in that endeavor, then my thanks be to you. ;-)
 
Old 03-27-2004, 06:00 PM   #9
TheOneAndOnlySM
Member
 
Registered: Jul 2003
Location: Dallas, TX
Distribution: Ubuntu 10.04 LTS
Posts: 987

Original Poster
Rep: Reputation: 30
thanks everyone!

i setup my /etc/rc.d/rc.inet1.conf (yes, i use slackware) and modified the GATEWAY line as i needed to do so

now how can i check test the gateway? and if this gateway is being used, then is it necessary to still use iptables?
 
Old 03-27-2004, 06:09 PM   #10
syberdave
LQ Newbie
 
Registered: Oct 2003
Distribution: slackware
Posts: 13

Rep: Reputation: 0
well.. if the gateway is configured correctly, you would be able to access the external network (the internet, in your case)...
but if you were able to access the internet without configuring that, it most likely has been configured by DHCPCD already.

since you have a router already, you wouldn't need iptables. iptables is a firewall and also lets your computer be a gateway.
 
Old 03-27-2004, 06:12 PM   #11
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Quote:
thanks everyone!

i setup my /etc/rc.d/rc.inet1.conf (yes, i use slackware) and modified the GATEWAY line as i needed to do so
that was a guess on my part, since slack is listed as your first os.

Quote:
now how can i check test the gateway? and if this gateway is being used, then is it necessary to still use iptables?
i'd take a look at the security references thread,

http://www.linuxquestions.org/questi...threadid=45261

better to be safe than sorry.

and once again, i'd like to apologize for the bogus info, i felt terrible, i'm glad you got it sorted. good luck.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Some questions on Setting up a Router/Gateway Riddick Linux - Networking 2 09-27-2005 05:24 PM
Setting the default gateway permanently hcclnoodles Linux - Newbie 5 09-26-2005 04:15 AM
dhclient not setting default gateway - no WAN route kadissie Linux - Networking 2 03-10-2005 04:55 AM
Setting up Router/Default Gateway with Redhat 9.0 Tutorial bmfmyth Linux - Networking 3 08-31-2004 03:47 PM
Setting default gateway from CLI? Pcghost Linux - Networking 1 03-20-2003 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration