LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   name resolution problem (https://www.linuxquestions.org/questions/linux-networking-3/name-resolution-problem-47261/)

mdwstmusik 02-26-2003 01:08 PM

name resolution problem
 
How can I force eth0 to use /etc/host and ppp0 to use my IPS DNS servers? I have a strange problem with Redhat 7.3. When I first boot my computer (without connecting to the internet) I can browse my LAN. Once I connect to my ISP with my NIC still active, all name resolution stops. I can't browse my LAN or the Internet. If I deactivate my NIC before I connect to the internet, I can then browse the internet. This is driving me nuts! Any suggestions would be appreciated.

rockdw 02-26-2003 01:58 PM

Sounds like a default route issue. You can have only one default route on a system. If you add another connection, then you will probably have issues with how the traffic is routed. For example, if you have the NIC first, the default route will likely be for the NIC, let's say that default route is 192.168.1.1 if you add the ppp0 connection, it will probably end up with something like 12.234.65.14 (completely random here, the actual address would be supplied by your ISP). Your default route is still 192.168.1.1
The problem comes from the interfaces not knowing how to appropriately route traffic. The 12.x.x.x address has no idea where to go, since your default is internal, and vice versa.

You could probably add a static route for one or the other connection so that traffic on a given network would know which way it is supposed to go.

Post this info:
netstat -rn with just the NIC
netstat -rn with just the ppp0
netstat -rn with the NIC AND ppp0 with the NIC attached first
netstat -rn with the NIC AND ppp0 with ppp0 attached first

and you will see what I am talking about.

mdwstmusik 02-26-2003 04:06 PM

This sounds right. The machine I'm on has a Conexant HSF modem, and (of course) it wasn't detected during setup. So, the default route must have been set through the NIC. I will post the results of the netstat -rn commands. How can I get around this problem? I tried

route del default
route add default ppp0

but no change.

mdwstmusik 02-26-2003 04:45 PM

O.K. the fog is starting to lift...
Here are the results of netstat

netstat -rn with just the NIC
Destination Gateway Genmask Flags MSS Window irtt Iface
10.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 10.255.255.254 0.0.0.0 UG 40 0 0 eth0

netstat -rn with just the ppp0
Destination Gateway Genmask Flags MSS Window irtt Iface
209.240.0.196 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 209.240.0.196 0.0.0.0 UG 40 0 0 ppp0

netstat -rn with the NIC AND ppp0 with the NIC attached first
Destination Gateway Genmask Flags MSS Window irtt Iface
209.240.0.196 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0
10.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 10.255.255.254 0.0.0.0 UG 40 0 0 eth0

netstat -rn with the NIC AND ppp0 with ppp0 attached first
Destination Gateway Genmask Flags MSS Window irtt Iface
209.240.0.196 0.0.0.0 255.255.255.255 UH 40 0 0 ppp0
10.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 40 0 0 lo
0.0.0.0 209.240.0.196 0.0.0.0 UG 40 0 0 ppp0

I see that the Gateway for 0.0.0.0 changes with whatever connection I start with first, and I can see in Network Configuration where to set a static route, but I'm not sure which values belong. To set a static route for eth0, do I set:

address 0.0.0.0
subnetmask 0.0.0.0
gateway 10.255.255.254

or

address 10.0.0.0
subnetmask 255.0.0.0
gateway 0.0.0.0

or, am I completely off base?

mdwstmusik 02-26-2003 04:58 PM

Got it! Rockdw thanks for the help.

rockdw 02-27-2003 09:53 PM

Glad to help


All times are GMT -5. The time now is 09:16 PM.