From: Steve Linberg on 9 Aug 2010 15:33 I have to put a file server on two different subnets on a company LAN: 192.168.6.0/24 and 192.168.25.0/24. The server is running CentOS 5.4 and a bare-bones SAMBA, which works fine, but I can't quite get the networking sorted out. The server has two NICs, each on one of the subnets. I have assigned each NIC a static IP, and I can ping both NICs from inside and outside the subnets they're on. However, I can only ping out on one of them, whichever one was brought up last. Here is a sample failure (using a pingable IP from yahoo.com as an example), showing eth0 failing and eth1 working: ============================================================ [root(a)fs-130maple ~]# ping -I eth0 209.191.122.70 PING 209.191.122.70 (209.191.122.70) from 192.168.6.5 eth0: 56(84) bytes of data. From 192.168.6.5 icmp_seq=2 Destination Host Unreachable From 192.168.6.5 icmp_seq=3 Destination Host Unreachable From 192.168.6.5 icmp_seq=4 Destination Host Unreachable ^C --- 209.191.122.70 ping statistics --- 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2999ms , pipe 3 [root(a)fs-130maple ~]# ping -I eth1 209.191.122.70 PING 209.191.122.70 (209.191.122.70) from 192.168.25.4 eth1: 56(84) bytes of data. 64 bytes from 209.191.122.70: icmp_seq=1 ttl=48 time=92.3 ms 64 bytes from 209.191.122.70: icmp_seq=2 ttl=48 time=89.9 ms 64 bytes from 209.191.122.70: icmp_seq=3 ttl=48 time=90.9 ms ============================================================ If I bring them both down and then bring them up in the reverse order, eth0 will work and eth1 will fail. IPTables can be on or off and doesn't affect the problem. I am not doing any explicit routing here, and maybe I need to? I have never put two NICs on different class Cs before, so I imagine I'm missing a step, but I haven't been able to figure it out. Any help appreciated. Relevant configuration files follow, happy to supply more as needed, and/or accept dope-slaps as needed. /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=yes HOSTNAME=fs-130maple /etc/sysconfig/network-script/ifconfig-eth0 DEVICE=eth0 BOOTPROTO=static BROADCAST=192.168.6.255 HWADDR=00:26:B9:8D:E4:5B IPADDR=192.168.6.5 # IPV6INIT=yes # IPV6_AUTOCONF=yes NETMASK=255.255.255.0 NETWORK=192.168.6.0 ONBOOT=yes GATEWAY=192.168.6.1 /etc/sysconfig/network-script/ifconfig-eth1 DEVICE=eth1 BOOTPROTO=static BROADCAST=192.168.25.255 HWADDR=00:10:18:65:44:89 IPADDR=192.168.25.4 # IPV6INIT=yes # IPV6_AUTOCONF=yes NETMASK=255.255.255.0 NETWORK=192.168.25.0 ONBOOT=yes GATEWAY=192.168.25.1
From: David Schwartz on 10 Aug 2010 04:07 On Aug 9, 12:33 pm, Steve Linberg <st...(a)silicongoblin.com> wrote: > [root(a)fs-130maple ~]# ping -I eth0 209.191.122.70 > PING 209.191.122.70 (209.191.122.70) from 192.168.6.5 eth0: 56(84) bytes > of data. > From 192.168.6.5 icmp_seq=2 Destination Host Unreachable > From 192.168.6.5 icmp_seq=3 Destination Host Unreachable > From 192.168.6.5 icmp_seq=4 Destination Host Unreachable Look at the error you got. Should this packet have gone to 192.168.6.5? And should 192.168.6.5 know how to reach 209.191.122.70? If your answers are "yes" and "no", then it's not supposed to work. If the answer to the first question is "no", then your routing table is broken. If the answer to the second question is "yes" then the routing table on 192.168.6.5 is broken. DS
From: habibielwa7id on 10 Aug 2010 04:28 On Aug 9, 10:33 pm, Steve Linberg <st...(a)silicongoblin.com> wrote: > I have to put a file server on two different subnets on a company LAN: > 192.168.6.0/24 and 192.168.25.0/24. The server is running CentOS 5.4 and > a bare-bones SAMBA, which works fine, but I can't quite get the > networking sorted out. The server has two NICs, each on one of the > subnets. > > I have assigned each NIC a static IP, and I can ping both NICs from > inside and outside the subnets they're on. However, I can only ping out > on one of them, whichever one was brought up last. Here is a sample > failure (using a pingable IP from yahoo.com as an example), showing eth0 > failing and eth1 working: > > ============================================================ > [root(a)fs-130maple ~]# ping -I eth0 209.191.122.70 > PING 209.191.122.70 (209.191.122.70) from 192.168.6.5 eth0: 56(84) bytes > of data. > From 192.168.6.5 icmp_seq=2 Destination Host Unreachable > From 192.168.6.5 icmp_seq=3 Destination Host Unreachable > From 192.168.6.5 icmp_seq=4 Destination Host Unreachable > ^C > > --- 209.191.122.70 ping statistics --- > 4 packets transmitted, 0 received, +3 errors, 100% packet loss, time > 2999ms > , pipe 3 > [root(a)fs-130maple ~]# ping -I eth1 209.191.122.70 > PING 209.191.122.70 (209.191.122.70) from 192.168.25.4 eth1: 56(84) > bytes of data. > 64 bytes from 209.191.122.70: icmp_seq=1 ttl=48 time=92.3 ms > 64 bytes from 209.191.122.70: icmp_seq=2 ttl=48 time=89.9 ms > 64 bytes from 209.191.122.70: icmp_seq=3 ttl=48 time=90.9 ms > ============================================================ > > If I bring them both down and then bring them up in the reverse order, > eth0 will work and eth1 will fail. IPTables can be on or off and doesn't > affect the problem. > > I am not doing any explicit routing here, and maybe I need to? I have > never put two NICs on different class Cs before, so I imagine I'm > missing a step, but I haven't been able to figure it out. Any help > appreciated. Relevant configuration files follow, happy to supply more > as needed, and/or accept dope-slaps as needed. > > /etc/sysconfig/network > NETWORKING=yes > NETWORKING_IPV6=yes > HOSTNAME=fs-130maple > > /etc/sysconfig/network-script/ifconfig-eth0 > DEVICE=eth0 > BOOTPROTO=static > BROADCAST=192.168.6.255 > HWADDR=00:26:B9:8D:E4:5B > IPADDR=192.168.6.5 > # IPV6INIT=yes > # IPV6_AUTOCONF=yes > NETMASK=255.255.255.0 > NETWORK=192.168.6.0 > ONBOOT=yes > GATEWAY=192.168.6.1 > > /etc/sysconfig/network-script/ifconfig-eth1 > DEVICE=eth1 > BOOTPROTO=static > BROADCAST=192.168.25.255 > HWADDR=00:10:18:65:44:89 > IPADDR=192.168.25.4 > # IPV6INIT=yes > # IPV6_AUTOCONF=yes > NETMASK=255.255.255.0 > NETWORK=192.168.25.0 > ONBOOT=yes > GATEWAY=192.168.25.1 -Yes it's not easy to reach the WAN from 2 NICs at the same time not only on Linux but on all OSs, Why you want to do this in your set-up, Your server is working fine as you mentioned, So I think it's not important to reach the Internet from the 2 NICs at the same time, Set the default gateway to go through 1 NIC so you have Internet connection on the server and it's internal networking is working fine as you mentioned, If you want to reach the Internet from the 2 NICs at the same time you must do many steps and it's not easy, I did that some times before but using some helpful scripts, As to do this manually will take some time and efforts, Search the web about multi home networking or multi wan connections on Linux. Regards,
From: Moe Trin on 10 Aug 2010 11:35 On Mon, 09 Aug 2010, in the Usenet newsgroup comp.os.linux.networking, in article <steve-D97060.15332709082010(a)news.us.easynews.com>, Steve Linberg wrote: >I have assigned each NIC a static IP, and I can ping both NICs from >inside and outside the subnets they're on. However, I can only ping >out on one of them, whichever one was brought up last. Smells of default route problems. >If I bring them both down and then bring them up in the reverse order, >eth0 will work and eth1 will fail. IPTables can be on or off and >doesn't affect the problem. /sbin/route -n >/etc/sysconfig/network-script/ifconfig-eth0 >GATEWAY=192.168.6.1 >/etc/sysconfig/network-script/ifconfig-eth1 >GATEWAY=192.168.25.1 The scripts/tools used assume that the "GATEWAY" is the default gateway to the world. You have declared two gateways - which is going to put two defaults Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.6.0 0.0.0.0 266.255.255.0 U 0 0 0 eth0 192.168.25.0 0.0.0.0 266.255.255.0 U 0 0 0 eth1 0.0.0.0 192.168.6.1 0.0.0.0 UG 0 0 0 eth0 0.0.0.0 192.168.25.1 0.0.0.0 UG 0 0 0 eth1 So - which one leads to the world? If you ever learned anything about programming, you'd know there can only be one default. The kernel knows this, and chooses the last one declared. If both routes must be listed (why), then either use policy routing (man tc) or set up a routing daemon on the routers and all systems that need to have the capability of using both default routes. An easier solution is to NOT specify the "second" default route. Old guy
From: Marc Haber on 13 Aug 2010 09:52 Steve Linberg <steve(a)silicongoblin.com> wrote: >I have to put a file server on two different subnets on a company LAN: >192.168.6.0/24 and 192.168.25.0/24. The server is running CentOS 5.4 and >a bare-bones SAMBA, which works fine, but I can't quite get the >networking sorted out. The server has two NICs, each on one of the >subnets. > >I have assigned each NIC a static IP, and I can ping both NICs from >inside and outside the subnets they're on. However, I can only ping out >on one of them, whichever one was brought up last. Here is a sample >failure (using a pingable IP from yahoo.com as an example), showing eth0 >failing and eth1 working: You can only have one default route. Why do you need to reach the Internet on both LANs? Greetings Marc -- -------------------------------------- !! No courtesy copies, please !! ----- Marc Haber | " Questions are the | Mailadresse im Header Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/ Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834
|
Pages: 1 Prev: tc filter problems Next: virtual centos box on windows VMware |