Probems with network and some dns too, I think

Discuss Networking
User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Probems with network and some dns too, I think

Post by Basher52 » Wed Jan 14, 2009 1:37 am

I got some network problems with a F10 install now.
It used to work fine, but since I put the 2nd NIC in it started to mess up. Last night it took it 10 minutes to start this install up. Some network daemons like httpd took like 3-4 minutes to get started, I can't remember the others. But no error that I could see.
And when it finally got up, I couldn't get any access to internet. I used to ping an ftp from a University in my town where I usually get my distros from, but it just told me it can't find it.

I now have two NICs in that machine, one for internet and the other for the internal network and I thought since the eth0(internet side) got it's IP from DHCP that I also would get my ISP's DNS addresses, like my winblow PC does, but nope.
When I ran it with only one NIC for the internal network it worked since I wrote the DNS addresses manually, but after I put the new NIC in, the access to both the external net and my internal keeps messing with me.

I've been trying to find the error but dmesg says nothing and I can't find any else error.

I hope you can help out or I'll have to reinstall it all to fix it.
I don't know if this is enough info for you and the worst case scenario is only to reinstall and that ain't too much work.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 10:11 am

It sounds like a simple routing issue where it's probably setting your default route to your internal network.
netstat -rn
and
ifconfig


and
cat /etc/sysconfig/network
and assuming the interface names are eth0 and eth1:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
cat /etc/sysconfig/network-scripts/ifcfg-eth1
I should be able to tell you exactly what you need to do to fix it with the answers to those questions.

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 12:39 pm

Code: Select all

[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.67.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
82.196.122.0    0.0.0.0         255.255.254.0   U         0 0          0 eth0
0.0.0.0         192.168.67.124  0.0.0.0         UG        0 0          0 eth1

Code: Select all

[root@localhost ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:10:B5:D1:07:8E  
          inet addr:82.196.123.xxx  Bcast:82.196.xxx.255  Mask:255.255.254.0
          inet6 addr: fe80::210:b5ff:fed1:78e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4659 errors:0 dropped:0 overruns:0 frame:0
          TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:362818 (354.3 KiB)  TX bytes:13603 (13.2 KiB)
          Interrupt:11 Base address:0xcf00 

eth1      Link encap:Ethernet  HWaddr 00:04:75:D2:79:2E  
          inet addr:192.168.67.124  Bcast:192.168.67.255  Mask:255.255.255.0
          inet6 addr: fe80::204:75ff:fed2:792e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:385821 errors:0 dropped:0 overruns:1 frame:0
          TX packets:589 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:31595904 (30.1 MiB)  TX bytes:81289 (79.3 KiB)
          Interrupt:5 Base address:0xae80 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1918 (1.8 KiB)  TX bytes:1918 (1.8 KiB)

Code: Select all

[root@localhost ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=

Code: Select all

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth0
HWADDR=00:10:b5:d1:07:8e
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth1
HWADDR=00:04:75:d2:79:2e
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.67.124
ONBOOT=yes
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
GATEWAY=192.168.67.250

and I remembered that I can't active/Inactive or delete any configured NIC and I used to be able to do that in previous versions
Last edited by Basher52 on Wed Jan 14, 2009 3:22 pm, edited 1 time in total.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 1:09 pm

Your internal network is 192.168.67.0/24. In the configuration for the internal network interface (ifcfg-eth1) you are specifying a GATEWAY of "192.168.67.250" which when you start up your network would become your default route. I assume you do not want your internet traffic to go through that address right? All you should have to do is comment that line out (or if you used a GUI to configure your interfaces remove that gateway address from the configuration). Your networking should then work like you want. The DHCP configuration on your other interface should automatically set the default gateway to your provider's router address but it is getting overridden by the gateway specified in your local interface's configuration.

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 1:33 pm

That I have tried but with the result:

Code: Select all

[root@localhost ~]# ping ftp.sunet.se 
ping: unknown host ftp.sunet.se
I also restarted the network.

and the /etc/resolv.conf is empty and that can't be correct.

Code: Select all

 Generated by NetworkManager


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
my other machine has a resolv.conf look like this

Code: Select all

search xxxx.se
nameserver 213.84.198.xxx
nameserver 213.84.201.xxx

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 2:33 pm

"PEERDNS=true" in your your Internet interface configuration should take care of the DNS, which you have. You might want to start looking at your logs (/var/log/messages) after a network restart. After you made the changes how do all the files look that I asked about? Did you use a GUI or did you edit then directly?

Also, there is a new service in the last couple of releases called "NetworkManager" that automates more of the networking (more for laptops with wireless connections, etc). Just doing a "service network restart" probably won't do it and you'll also need to do a "service NetworkManager restart" or reboot. You can also disable the NetworkManager and go back to the old way of using the "network" service. Make sure it's enabled.

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 3:22 pm

I made the changes manually just to be sure and since you told me how to. (Totally forgot the NetworkManager :oops: )
I also changed the PEERDNS for my eth1(local) NIC to 'no' now but still the same result.

The info now looks like this:

Code: Select all

[root@localhost ~]# netstat -rn      
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.67.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
82.196.122.0    0.0.0.0         255.255.254.0   U         0 0          0 eth0
0.0.0.0         192.168.67.124  0.0.0.0         UG        0 0          0 eth1
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# ifconfig            
eth0      Link encap:Ethernet  HWaddr 00:10:B5:D1:07:8E  
          inet addr:82.196.123.xxx  Bcast:82.196.xxx.255  Mask:255.255.254.0
          inet6 addr: fe80::210:b5ff:fed1:78e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:146614 errors:0 dropped:0 overruns:0 frame:0
          TX packets:279 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10490150 (10.0 MiB)  TX bytes:54504 (53.2 KiB)
          Interrupt:11 Base address:0xcf00 

eth1      Link encap:Ethernet  HWaddr 00:04:75:D2:79:2E  
          inet addr:192.168.67.124  Bcast:192.168.67.255  Mask:255.255.255.0
          inet6 addr: fe80::204:75ff:fed2:792e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:557480 errors:0 dropped:0 overruns:1 frame:0
          TX packets:29782 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:46844515 (44.6 MiB)  TX bytes:9862247 (9.4 MiB)
          Interrupt:5 Base address:0xae80 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:44 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3080 (3.0 KiB)  TX bytes:3080 (3.0 KiB)

[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth0
HWADDR=00:10:b5:d1:07:8e
BOOTPROTO=dhcp
ONBOOT=yes
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NM_CONTROLLED=yes
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
TYPE=Ethernet
DEVICE=eth1
HWADDR=00:04:75:d2:79:2e
BOOTPROTO=none
NETMASK=255.255.255.0
IPADDR=192.168.67.124
ONBOOT=yes
USERCTL=no
PEERDNS=no
IPV6INIT=no
NM_CONTROLLED=yes
#GATEWAY=192.168.67.250
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
domain bahnhof.se
search bahnhof.se
nameserver 213.84.198.xxx
nameserver 213.84.201.xxx
After I restarted the NetworkManager I got the DNS info in my resolv.conf
but still get: 'ping: unknown host ftp.sunet.se'

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 3:31 pm

Notice your routing table has 192.168.67.124 set as the default gateway (your own local inside network interface) which is wrong. I don't know why that's getting set but the configuration for your eth1 is wrong. How did you originally configure the new interface, in a GUI? If so, go back into that GUI (system-config-network) and check to see if you have "192.168.67.124" set anywhere as your "default gateway" then restart NetworkManager. I'm still a little fuzzy on NetworkManager which is why I usually disable it on servers and go with the old way of configuring. I'll dig around while you are doing that to see if I can come up with a more precise location of that configuration for NetworkManager.

You can manually set the proper default route by checking what your internet provider told you your default router should be in your DHCP configuration. You can find that information in /var/lib/dhclient/dhclient-eth0.leases file in the "routers" tag.

Say that tag was "82.196.122.1" you would first remove the bogus default route you currently have set:

Code: Select all

# route delete default gw 192.168.67.124
then add the proper route

Code: Select all

# route add default gw 82.196.122.1
Now that won't be permanent, it'll get wiped out next time you restart network unless you got your network config straightened out.

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 3:52 pm

I can't find anything with gateway in it except the Default gateway address line and that is empty.

oh btw, what's with this thing that I can't active/deactiveate/delete devices?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 4:24 pm

Where can't you do these things? Also, did you try to manually set the default route as I described to make sure everything works the way you want once you get the configuration fixed?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 4:29 pm

Oh, and since your configs look right why not just get NetworkManager out of the loop and see if it works right with the normal old network service.

# chkconfig NetworkManager off
# service NetworkManager stop
# chkconfig network on
# service network restart

If it's still clobbering your default route you might also try bringing both interfaces down and back up but make sure you bring the internet one up after the local one. This could give us a better idea of where to look next:

# ifdown eth1
# ifup eth1
# ifdown eth0
# ifup eth0

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 4:40 pm

Yep, that did it. Funny that my other machine work then, it has also two NICs one internal and one external and I haven't stop the NM there.

this is the netstat -rn now

Code: Select all

[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.67.0    0.0.0.0         255.255.255.0   U         0 0          0 eth1
82.196.122.0    0.0.0.0         255.255.254.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         82.196.122.1    0.0.0.0         UG        0 0          0 eth0
The 169.254.x.x address is some automatically added, right.
and that address is also on the external NIC, can I remove that permanently? It might be a way in... or?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 4:50 pm

Yes there is a way to get rid of that but it shouldn't really cause you an issue. I gotta break for a few hours so I'll check into it and get back with you. As far as why wasn't it working with NetworkManager I'll check into that as well but I'm sure it is because NetworkManager uses configs in other locations than what I am used to with the plain old network service. I'll also dig into that. Glad you got it working!

User avatar
Basher52
guru
guru
Posts: 925
Joined: Wed Oct 22, 2003 5:57 am
Location: .SE

Post by Basher52 » Wed Jan 14, 2009 4:52 pm

yeah, thanks man :)
I'm off to bed now it's almost 12AM so no rush on that

thx again

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Jan 14, 2009 10:45 pm

Add "NOZEROCONF=yes" to your /etc/sysconfig/network to get rid of those zeroconf routes.

Post Reply