LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-04-2007, 09:32 AM   #1
Arrowx7
Member
 
Registered: Jul 2004
Posts: 43

Rep: Reputation: 15
setting gateway for network interface (newbie question)


Hello,
In windows when setting up a network connection you enter the IP, subnet mask, etc.. I learned how to do all that in linux, but I was puzzled how to set the gateway and DNS IP.
For instance, the DHCP router on my network is 192.168.1.2, but the gateway to the internet is actually 192.168.1.1
When I connect to my network linux automatically takes 192.168.1.2 as the gateway, but it's wrong. Is there a way to set 192.168.1.1 as the gateway?
What would be the command?

Thanks in advance guys!!
 
Old 03-04-2007, 10:06 AM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
to set the gateway via command line, as root run below command.

route add default gw 192.168.1.1

to set the dns server, edit the /etc/resolv.conf
something like nameserver xxx.xxx.xxx.xxx will do.

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
gateway setting ./network-scripts/ifcfg-eth1 and ./network joshfields Linux - Networking 1 04-29-2012 04:27 AM
Setting up a Network Gateway Gomi Linux - Networking 2 03-24-2005 06:15 PM
Setting up a Home Network Gateway. Riddick Linux - Networking 2 06-16-2004 08:58 PM
Setting Network Interface Speed ITJedi Linux - Networking 4 05-14-2004 11:02 PM
Newbie setting up mandrake 9.2 as a gateway williamt74 Linux - Networking 4 03-09-2004 08:34 AM

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

All times are GMT -5. The time now is 08:13 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