LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-17-2006, 04:19 AM   #1
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Rep: Reputation: 15
DHCP gateway question


Hello,

Here is my scenario:

I have two gateways, and a dhcp server.

When I setup my debian it takes a default gateway (192.168.1.254) which I do not want to use. I just want to use the other one (192.168.1.3).

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.254 0.0.0.0 UG 0 0 0 eth0
debian:/usr/lib/apache-tomcat-5.5.16/bin#

I know how to do it with static IP, but not with DHCP.

Here is my interfaces:

debian:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
gateway 192.168.1.3
debian:/etc/network#

And it is not taking the gateway I want, how to do it?

Thank you.
 
Old 05-18-2006, 05:13 AM   #2
Fernandoch
Member
 
Registered: Mar 2002
Location: Spain
Distribution: Debian, Cent OS, RHEL
Posts: 119

Original Poster
Rep: Reputation: 15
This is how I have fixed it:

Code:
debian:/etc/network# cat interfaces 
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
netmask 255.255.255.0
up route delete -net default gw 192.168.1.254
up route add -net default gw 192.168.1.3
name Ethernet LAN card
Is it correct?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
dhcp does not set gateway pantoniades Linux - Networking 4 02-14-2006 05:26 AM
No gateway from DHCP when using wireless tnine9 Linux - Wireless Networking 0 01-30-2005 01:00 PM
Setting up a gateway/dhcp server. chaosego Linux - Wireless Networking 33 09-26-2004 07:50 AM
DHCP and Gateway Renfro Linux - Networking 1 08-28-2003 07:22 PM
linux gateway and DHCP weazy Linux - Networking 3 03-19-2003 04:30 PM


All times are GMT -5. The time now is 05:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration