Buzz27 Posted March 15, 2008 Report Share Posted March 15, 2008 Hi, I have 3 servers connected to a Draytek Adsl2+ voip router. 2 currently running Linux ( various distro's under test) and 1 running windows 2000 server( but soon to be replaced with a versions of linux able to run Virtualbox ( which I'm having a few teething problems with at the moment, see my other thread!) My question/ problem is I also have a MS windows Lan set up with a different ip range- same subnet which I have all my servers linked into via a gigabyte switch. All servers have 2 NIC's ( 1 connected to my router, and the other to my Lan ). These are primarily dual channel gigabyte NIC's ( I'm a bit of a speed freak, when I can get it)!, although I haven't set the Linux box's up with bonding yet ( not sure if they even support this)? Back to my problem, I don't seem to be able to set which interface ( NIC) is my WAN and which is my LAN, so only seem to be able to use 1 at a time. If I enable both, my WAN ( ADSL) stops working, although I am still able to browse my LAN. Any ideas? My setup is ML350 running Mandriva 2.6.22.16-desktop, ML370 running Scientific/Mandriva/ Centos, Ml370 running Win2000 server. + Various PC's on LAN running Windows. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted March 15, 2008 Report Share Posted March 15, 2008 It could be because you have two different default gateways set. There should always only be one configured, and since the LAN side is the switch, there should be no need to configure a default gateway here. Therefore, the default gateway for all machines should be the internet router so that they can access the internet for all addresses other than the recognised internal ones. The LAN will work fine without a default gateway if you're only using one IP range because there is no need to route anything if it's not outside of the LAN IP range. Then, anything outside of this will go to the second network card and therefore to the internet when the internal router/dsl gateway realises it's not a recognised internal IP. Your ADSL probably doesn't stop working as such, because the router is managing the connection. What you mean is, that it's not routing your internet bound connections, because the default gateway is not your internal router, but something else. So ensure you've only got one default gateway configured for the internet connection and not for the LAN connections. You can verify this for us by providing: ifconfig -a and: route -n these need to be ran as root, or su first to superuser mode to provide this info. Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 17, 2008 Author Report Share Posted March 17, 2008 Ian, I have tried setting the 2 interfaces with the router ip as the gateway but have had no luck accessing the internet with the LAN xconn connected. My setup always worked fine in a Windows environment, but maybe I need to re-configure this for Linux ( I did however have a box setup with Scientific, the same as my Win2k server and this worked fine). Not quite sure what the problem is? If I set up eth3 with my router IP as the gateway it doesn't even connect ( in Network Center). I can set it up from the terminal but still no joy. If I leave the DNS blank, it fills this in with 172.16.0.2. The gateway for my router is set as itself. ( 192.168.1.1) My IP setup is: eth0 Link encap:Ethernet HWaddr 00:0B:CD:C9:C3:2D inet addr:192.168.1.252 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20b:cdff:fec9:c32d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:60 errors:0 dropped:0 overruns:0 frame:0 TX packets:56 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6153 (6.0 KiB) TX bytes:7380 (7.2 KiB) Interrupt:18 eth2 Link encap:Ethernet HWaddr 00:11:0A:5D:5F:AD UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Base address:0x3040 Memory:f7e60000-f7e80000 eth3 Link encap:Ethernet HWaddr 00:11:0A:5D:5F:AC inet addr:172.16.0.23 Bcast:172.16.0.255 Mask:255.255.255.0 inet6 addr: fe80::211:aff:fe5d:5fac/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:416 errors:0 dropped:0 overruns:0 frame:0 TX packets:300 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:40373 (39.4 KiB) TX bytes:30804 (30.0 KiB) Base address:0x3000 Memory:f7ee0000-f7f00000 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:2121 (2.0 KiB) TX bytes:2121 (2.0 KiB) Routing is: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0 172.16.0.0 0.0.0.0 255.255.255.0 U 5 0 0 eth3 169.254.0.0 0.0.0.0 255.255.0.0 U 5 0 0 eth3 169.254.0.0 0.0.0.0 255.255.0.0 U 10 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 172.16.0.21 0.0.0.0 UG 5 0 0 eth3 0.0.0.0 192.168.1.1 0.0.0.0 UG 10 0 0 eth0 Hopefully someone can enlighten me here! Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted March 18, 2008 Report Share Posted March 18, 2008 Yes, you have two default gateways configured. The two last entries of 0.0.0.0 hint at two default gateways being configured, which is why your network has no idea where to go for internet or addresses not configured on your system. So, assuming by your post that eth3 is the internet link, ensure that eth0 is configured without a default gateway, so remove that 192.168.1.1 address - you just don't need it. You can test this easily by: route del default gw 192.168.1.1 and then see if your internet starts working. Now, if I got it wrong, and 192.168.1.1 is your router, then I wonder why eth3 has the 172 ip range if it's not your internal network. If so, then just delete the opposite gateway address, and leave the 192 address. I don't have a clear picture of what IP is for what. Which IP you use for the internet? And which IP you use for the switched network and servers? Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 18, 2008 Author Report Share Posted March 18, 2008 Ian, It's the later. My router has the 192.168.1.0 range ( eth0) and my Switch/Lan is the 172.16.0.0 range.(eth3). I had it this way to enable me to download from the net and transfer files across my lan without affecting the bandwidth. I have tried to delete the gateway on my lan ( eth3) and leave it blank in Network Center but it just automatically adds 172.16.0.2, so I set it as my windows server address (172.16.0.21) just to have it connect and give the routing details you requested. When I add the router 192.168.1.1 address it doesn't even connect. ( I can set this in the terminal window, but there's no difference). I suppose I could put the switch up front between the router , but would have to set the firewalls on all servers to allow each other to connect and transfer between themselves. I always thought my setup would be the most secure for my servers, and still allow me to connect to other computers on my Lan. Even though all the servers have 192.168.1.0 addresses I transfer files between them over the Lan backend via my switch. Would you have them configured differently? Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 18, 2008 Author Report Share Posted March 18, 2008 Ian, Yet again you have come up trumps. I restarted eth3 with my internal gateway set at 172.16.0.21 ( so it would start) also put in my ISP's dns in both eth0 and eth3 then deleted the internal gateway with the : # route del default gw 172.16.0.21 Both now work okay. Not sure why it kept putting a gateway in on Network Center. it just doesn't like blanks. It goes to show running commands from the terminal is much more reliable.( just like the old Dos days). I had a similar problem with a Debian based distro which just wouldn't work with their network interface setup, every reboot I would have to reset the settings in the terminal window 'Ifconfig' etc ( which is just one reason why I switched distro). Thanks for your help ( Its all good experience, and I can only learn as I go) picking up the little quirks of each distro on the way. So far I am happy with Mandriva, I like the way it presents its control centers ( although they do seem to have some problems ,as this shows). :D :D How would you have setup my network? Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 18, 2008 Author Report Share Posted March 18, 2008 Well looks like I spoke to soon!! When I rebooted this morning , I had the faulty routing back. As I don't seem to be able to leave the gateway blank on eth3 ( Lan), and setting it to the router gateway 192.168.1.1 - disables it from starting eth3, I'm faced with having to start eth3 with my old Lan proxy gateway and then run the 'route del' command every time I boot. Is there any way I can correct this permanently? Quote Link to comment Share on other sites More sharing options...
David Batson Posted March 18, 2008 Report Share Posted March 18, 2008 (edited) I believe your answer and solution might be in the following thread: How do I protect changes to resolv.conf? Edited March 18, 2008 by David Batson Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted March 18, 2008 Report Share Posted March 18, 2008 You could add the route del command to /etc/rc.local however, what it would be best to do is look in /etc/sysconfig/network and see if the two gateway addresses are configured in here. If they are, remove the one you don't want. If not, then check /etc/sysconfig/network-scripts/ifcfg-ethx where x is the eth0 or eth3 and see if the gateway is listed in here. If it is, then just remove the whole line that relates to the gateway. Then that should fix your problem. Normally, if you only have one gateway configured it's in /etc/sysconfig/network from what I remember, but it doesn't matter as it can also be listed in the interface too. /etc/sysconfig/network is a file as well as /etc/sysconfig/network-scripts/ifcfg-ethx. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted March 18, 2008 Report Share Posted March 18, 2008 As for the network, I would have set it up differently, but using just one network card in each machine. It would look something like this: PC --> Switch --> Gateway/Router --> Internet Connection. I will then assume each computer just uses eth0. I would then configure eth0 for the IP address with the internet connection. Then, after this has been done, I would then do an: ip addr add dev eth0 172.16.x.x/24 then, you would have the appropriate second IP for your internal servers, and save having to use two network cards. However, both work perfectly fine. The bonus of having two network cards is that you can ensure that IP routing isn't enabled and the two networks can't therefore be bridged. My machines only have one network card, hence I would have two IP's on the card. For a office network, I would do it completely different again ;) Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 20, 2008 Author Report Share Posted March 20, 2008 I may have a go setting up my network slightly different , similar to your suggestions, as what ever I do to the gateway address on my ethx changes back on a reboot ( mainly due to the NIC not starting unless its own ip range is used in the gateway). Blanks/ other ranges dont seem to be excepted to start the interface. I have to run : # route del default gw 172.16.0.21 after each restart of the internal eth3 My current setup is: PC ( Lan) ....> Hub ( 100M) ....> Switch ( GB) ....> Server1 .....> router ...> Internet ...................................................................<...........> Server2 ....> ....................................................................<..........> Server3 ....> All my servers are connected to both the Extl router and Gigabit switch, allowing me to sent data between each server at the fastest possible rate without affecting the Wan/ Internet xcon. I may put the switch upfront( as in your setup), and send data that way ( between each other as traffic on my ADSL2+ should only be low compared to my switch capacity, especially if I can get bonding to work with Mandriva on the dual GB nics ). Do you have any Idea how to achieve this, would I need a different kernel , or isn't it supported yet? I was looking at making one a pure file server anyway. Would you recommend NFS or SMB for this? I've not had much success with any between Linux box's, but Linux to Windows works every time. I did look at the link posted : http://forum.mandriva.com/viewtopic.php?t=79053 but this seems only to deal with DNS settings, which I have no problems setting already. Looks like I'll have to stick with resetting the gateway every reboot, until a possible fix. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted March 20, 2008 Report Share Posted March 20, 2008 Can you post the contents of the following files for me: /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth3 then I'll take a look at what's going on. With regards your suggested setup, is there any reason you put the servers between the switch and router? I'm not sure how clear it is in terms of how you want to set it up. Are they connected to the router or the switch? How many ports on the switch? Any reason for the hub? Quote Link to comment Share on other sites More sharing options...
Buzz27 Posted March 25, 2008 Author Report Share Posted March 25, 2008 Can you post the contents of the following files for me: /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth3 then I'll take a look at what's going on. With regards your suggested setup, is there any reason you put the servers between the switch and router? I'm not sure how clear it is in terms of how you want to set it up. Are they connected to the router or the switch? How many ports on the switch? Any reason for the hub? etc/sysconfig/network: NETWORKING=yes HOSTNAME=NS03 /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE=eth0 BOOTPROTO=static IPADDR=192.168.1.252 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 ONBOOT=yes METRIC=10 MII_NOT_SUPPORTED=no USERCTL=no DNS1=212.139.132.4 RESOLV_MODS=yes LINK_DETECTION_DELAY=6 IPV6INIT=no IPV6TO4INIT=no /etc/config/network-scripts/ifcfg-eth3: DEVICE=eth3 BOOTPROTO=static IPADDR=172.16.0.23 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 ONBOOT=yes METRIC=5 MII_NOT_SUPPORTED=no USERCTL=no DNS1=212.139.132.4 RESOLV_MODS=yes IPV6INIT=no IPV6TO4INIT=no Route -n # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 172.16.0.0 0.0.0.0 255.255.255.0 U 5 0 0 eth3 192.168.1.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 5 0 0 eth3 169.254.0.0 0.0.0.0 255.255.0.0 U 10 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 192.168.1.1 0.0.0.0 UG 10 0 0 eth0 I have noticed I now am able to browse both networks If I don't go into Network center and start eth3 , although it takes a while to first access the internet. As can be seen route -n shows only one gateway on boot, but this changes if I go into Network Center and start eth3! (Network Center shows eth3 as disconnected whenever my server is started but functions okay). The hub at the back is because my Gigabit switch only has 8 port's, and as I previously had my server dual nic's bonded this took up 6 leaving only 2 free. I have multiple other PC's which are used when needed aswell as the ones I fix for others ( which I like to connect and update as required). I have the hub linked to the switch with a crossover, and currently run my windows 2000 server as a proxy server for the Lan.( this will be run virtually when I find a suitable Linux OS which will fill all my requirements). Mandriva is coming along well, ( has a few faults that need tweaking manually, but otherwise is okay so far). I guess my wish list would be : bonding of my HP dual port nic's, proper DVD support/playback ( like Intervideo WinDVD) faultless NTFS support ( although ntfs-3g is working okay, but a bit messy to get full control on new drives/ particularly USB etc). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.