LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   DHCP gateway question (https://www.linuxquestions.org/questions/debian-26/dhcp-gateway-question-445624/)

Fernandoch 05-17-2006 04:19 AM

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.

Fernandoch 05-18-2006 05:13 AM

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?


All times are GMT -5. The time now is 04:50 PM.