[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IP Address networking - best way?



On Fri, 2007-01-12 at 09:44 +0200, Justin Hartman wrote:
[...snip...]
> Without making a single change to the interfaces file I issued a
> /etc/init.d/networking restart command and low and behold my network
> just went down again with no access to the server so now I'm wondering
> if this has to do with the whole networking restart or the interfaces
> file itself.

Ok. Let me see. Are you using the network to access the machine at the
time you issue the "/etc/init.d/networking restart".

Lets think that through, you are connected to the machine through the
network. You then do a FULL start-stop-daemon (a program) restart on the
networking devices.

Hmmm. I wonder why when you basically TURN OFF the networking and clear
connections, your access DROPS. Wow, that's a tough one to finger.

What you should be doing is "ifdown eth0 ; ifup eth0" as that doesn't
clear all connections and resets the config for it, if changed.

Added addresses really should be done through an external script. I
arm-wrestled with Debian's init on this feature for quite a while. I
chose to use an external script that build the virtual NICs through the
proper commands.

After the initial device is made properly by Debian's init I use the
following command to setup the other addresses:

/sbin/ip -4 addr add 70.87.206.51/24 dev eth0 brd + scope global label eth0:V1
/sbin/ip -4 addr add 70.87.206.52/24 dev eth0 brd + scope global label eth0:V2
/sbin/ip -4 addr add 70.87.206.53/24 dev eth0 brd + scope global label eth0:V3
/sbin/ip -4 addr add 70.87.206.54/24 dev eth0 brd + scope global label eth0:V4
/sbin/ip -4 addr add 70.87.206.55/24 dev eth0 brd + scope global label eth0:V5
/sbin/ip -4 addr add 70.87.206.56/24 dev eth0 brd + scope global label eth0:V6
/sbin/ip -4 addr add 70.87.206.57/24 dev eth0 brd + scope global label eth0:V7
/sbin/ip -4 addr add 70.87.206.58/24 dev eth0 brd + scope global label eth0:V8

I put those commands in a separate file and call it right after
netpwrking is up.

Actually I created an init script froma  skeleton that reads a config
file with three fields in it. I call the functions for each NIC I have
(including ppp and wireless stuff if need be)

The config file looks like this:

	 70.87.206.51 24 eth0
	 70.87.206.52 24 eth0
	 70.87.206.53 24 eth0
	 70.87.206.54 24 eth0
	 70.87.206.55 24 eth0
	 70.87.206.56 24 eth0
	 70.87.206.57 24 eth0
	 70.87.206.58 24 eth0

My script is ugly, but the above actual commands will do it for you.
Also since you are not changing the netmask or gateway device this
really is the best way to add you aliased stuff.

> > I wonder if the original poster is having problems because he needs to
> > allow ip forwarding.
> 
> Not sure about this and I don't know how to check this out either.
> Sorry I know I'm seeming very dumb right now but networking is not
> something I'm very good at and I'm learning as I go along here...
> 
> Thank for all your patience

-- 
greg, greg@gregfolkert.net

The technology that is
Stronger, better, faster:  Linux

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: