Setting up a server with 2 network cards & ADSL
OK Linux people I need help -- again!
I've got a nice server set up here that does just what I need it to, except it's become unreliable. So, I'm replacing it. This server has been running for about 3 years now. I am currently preparing its replacement. The new server has Ubuntu 6.10 with kernel 2.6.17. Both servers have 2 network cards, one connects to the LAN switch (eth1) and one connects to the ADSL modem. (eth0). Three years ago when I set up the current server. I wrote down what I did. One of my instructions was "configure eth0 NOT to come up at boot time" but I can't remember how I did this. Old server works great. Eth1 takes care of the LAN, and eth0 is used as ppp0 and connects to the ADSL on boot. New server, has all kinds of routing table problems, and ifconfig shows Eth1, Eth0 AND ppp0 when connected. I think if I can just figure out how to get the eth0 to stay down, it would solve some problems. Just typing "ifconfig eth0 down" results in ppp0 not being able to connect. A little help? :) |
Umm I'm a little confused. Why would you want eth0 to stay down ?
it's a bit normal that ppp doesn't work when you do a "ifconfig eth0 down" since ppp uses eth0 to connect with your ADSL modem. no eth0, no ppp, no internet. one way I know of to stop eth0 from being hotplugged by udev at boot (although I don't know how this can help you) is to: edit /etc/conf.d/rc (using something like vim or nano) look for RC_PLUG_SERVICES="" in the file and add "!net.eth0" in the quotes. So it would look like : RC_PLUG_SERVICES="!net.eth0" should work, although i've never tried it on my ubuntu. Also, posting a few error messages like the one that tells you about the routing table problems might help. |
Well I don't want eth0 to up at boot because then it gives itself an IP address rather than using ppp0.
And, my route table is all messed up somehow. My main problem is I am swiching distros from Mandrake (RPM based kernel 2.4) to Ubuntu (Debian based, kernel 2.6) so all my config files from Mandrake are useless. For example my configuration on my existing Mandrake server is as follows: /etc/sysconfig/network-scripts/ifcfg-eth0 Code:
DEVICE=eth0 Code:
DEVICE=eth1 Code:
Of course on Debian everything is done differently. I found a file /etc/network/interfaces wich I assume does what my above files do, but the syntax is all different: Code:
# This file describes the network interfaces available on your system Here is my Ubuntu ifconfig: Code:
eth0 Link encap:Ethernet HWaddr 00:10:18:24:C9:4B Mandrake Code:
Destination Gateway Genmask Flags Metric Ref Use Iface Code:
Destination Gateway Genmask Flags Metric Ref Use Iface |
There are 2 problems in your /etc/network/interfaces that are not configured and therefore causing problems with your routing. The first is you need to specify eth1 static details;
auto eth0 iface eth0 inet static address 192.168.1.1 netmask 255.255.255.0 Now you need to specify in the ppp section that the lease address that it picks up is the gateway for the system. I have not used this method as we use pppoa in the UK which is all handled by the modem/router interface but it should be easy enough to find out how to specify this. I am not sure what you are using eth1 for in this mix. |
Hi TigerOC,
Sorry, I should have given more details about my setup. It looks like this: LAN -- eth1 -- Server -- eth0 (ppp0) -- ADSL modem -- Internet So the server sits between our local network and the Internet (adsl modem) The ISP provides us a public IP address via DHCP. Eth0 is plugged into the modem and eth1 is plugged into our Lan switch. I read the man page and have reconfigured my /etc/network/interfaces as follows: Code:
Is there any way I can get this to work at boot time: Eth1 - comes up at boot Eth0 - connects to ppp0/ADSL at boot time ip_forward is set properly at boot time I would like to have everythig work at start up - the less we have to type after booting up, the better. |
Make a small script;
Code:
#!/bin/sh chmod 700 ip_forward.sh. Test the script by doing /etc/init.d/ip_forward start which should execute without error. You can stop it by replacing start with stop. Now put it in the required run levels by doing as root (whilst still in /etc/init.d/);- update-rc.d ip_forward defaults 89 if any stage you wish to remove these soft links to this script do;- update-rc.d -f ip_forward remove |
Hi TigerOC,
Thanks for your help, I think it worked! Without IP forward I can't do anything except via my squid proxy. I.E. no email, can't ping, etc. I followed your direction and got this result: Code:
root@proxy:/etc/init.d# update-rc.d ip_forward.sh defaults 89 On my old Mandrake server, I had done the ip_forward setting in the init.d script, which I believe is similar to what we just did. But the ADSL, I believe, had its own script (which I no longer have access to since the Mandrake server died for good yesterday, and won't boot any more). Mandrake uses adsl-setup/adsl-connect and Debian/Ubuntu uses pon/poff for connections, so I couldn't just copy from the old server. I realise you don't use ADSL but I have a feeling this is a simple problem ... :) |
Yes do the same thing;
Code:
#!/bin/sh So how does this system work? In the UK we use pppoa and we use modem/routers that are permanently connected and the router connects via ethernet to the lan box. So all this is handled by the router in the modem/router. |
All times are GMT -5. The time now is 11:31 AM. |