为什么我需要重新启动 Ubuntu 14.04 LTS 才能使我的网络脚本正常工作?

为什么我需要重新启动 Ubuntu 14.04 LTS 才能使我的网络脚本正常工作?

当我开始在 Virtualbox VM (4.3.26) 上使用 13.04 LTS 时,我关闭了网络管理器并编写了一些脚本,用于在任何网络上动态更新笔记本电脑的静态 IP。我这样做是为了可以随身携带我的开​​发环境;我将设置存储在 git 分支中,为每个到达的网络创建一个具有不同设置的新设置,例如,如果我在汤姆家,我会运行:

$ git checkout tomsHouse
$ sudo ./updateConfiguration.sh

或者如果我在星巴克我会运行:

$ git checkout starbucks
$ sudo ./updateConfiguration.sh

加载的配置是以下内容的变体:

# Copy the configuration files out to their respective locations...
sudo cp ./dnsmasq.conf /etc/dnsmasq.conf
sudo cp ./interfaces /etc/network/interfaces

# Restart networking
sudo /etc/init.d/networking stop
sudo /etc/init.d/networking start

# Restart the dnsmasq service
sudo /etc/init.d/dnsmasq stop
sudo /etc/init.d/dnsmasq start

# Restart Lampp
sudo /opt/lampp/lampp_stop
sudo /opt/lampp/lampp_start

./更新配置.sh- 运行此程序来设置新配置...其余的只是配置文件......

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.2.45
netmask 255.255.252.0
gateway 10.0.0.1
dns-nameservers 127.0.0.1 4.2.2.2 8.8.8.8

./接口

当然还有dnsmasq配置文件文件只是更新其余配置以指向静态 IP 地址接口指向的任何地址。

当我升级到 14.04 LTS 时,我的网络切换脚本停止工作,我被迫重新启动以启用更改,而之前在 13.04 中我只需运行脚本,一切都会再次正常工作。

14.04 中是否存在可能导致其无法正常工作的改变?

相关内容