Can't access network interfaces anymore [Kinda urgent]

Hello,

I've bought an semi-dedicated (cloud computing) server, but yesterday I had to change my IP, so I tried this with PuTTY:

Went to

/etc/network/interfaces

And changed

iface eth0 inet static

To

iface eth0 inet dhcp

Hoping to get an dynamic IP

Then I restarted my network with:

/etc/init.d/networking restart

And then I lost my connection to the host, I've contacted the support team of the company that hosts it (actually it's hosted in Softlayer, but I've bought it from other vendor, 'cause I'm from Brazil), and he said he tried this:

/etc/network/interfaces:1

in the host computer, but didn't help... He wants to format the computer, but I would lost all my datas, and this is just unthinkable... What could I do, please? I'm desperate!

Thanks... Waiting anxiously for answers...

[I kinda now this isn't the best place to post this, but I'm desperate... Please understand]

If you can't get into it, there's not a lot you can do to it.

If they can get into it, can't they just undo your changes and restart?

So, it seems he can access the file, but even undoing the changes he said it's givin' errors... He sent me this screenshot:

It seems to be the file as it was, without my modifications, he didn't say what error was going on, I'll push him to give me more specific informations

-- UPDATE --

Ok se said he can edit and save the interfaces file, but when he restarts network (/etc/init.d/networking restart) it gives:

I told him to try chmod 777 /etc/network/interfaces

'Cause when I edited interfaces, I've donwloaded it with filezilla, edited and sent back, maybe chmods changed

edited it in what? If you edited it in a windows system you probably filled it with carriage returns, which could cause all sorts of weird syntax errors. They can fix it like

tr -d '\r' < /etc/whatever > /tmp/$$
cat /tmp/$$ > /etc/whatever
rm -f /tmp/$$

If you saved a copy of the original, that's even better.

And no no no. 777 is not the magic sledgehammer to fix all permissions problems. Do you really want that configuration file to be exectuable?

1 Like

Ok, it seems he went to lunch, I'll ask him to do this then:

tr -d '\r' < /etc/network/interfaces > /tmp/$$
cat /tmp/$$ > /etc/network/interfaces
rm -f /tmp/$$
reboot
ifdown -a
ifup -a
/etc/init.d/networking restart

Is there another shot I might try? This seems a logical line of commands to use? Should I ask him to get an interfaces from another server and try paste in there, making the necessary IP changes?

Also, is there a way to upload my server files in case of format needed? (There must be a way, format is just the "easy" way)

-- edit --

There are commands like ipconfig, netstat, route etc that might be useful to solve this? He said this is "unfixable", but nothing in computing is unfixable lol, I need suggestions please

-- edit 2 --

Ok, so I found this on the internet:

And really, it seems that in line 2 there's something wrong... There is an "i" before #

---------- Post updated at 02:10 PM ---------- Previous update was at 01:04 PM ----------

It worked!

The "i" was before the comment "#", he just deleted it and it worked!!

Thanks a lot for your suggestions!

1 Like

I can't believe I didn't notice that! :wall: Glad you got it going without a reformat.