ubuntu13.10通过执行shell脚本来设置静态ip地址

sh/bash/dash/ksh/zsh等Shell脚本
回复
zyjimo123
帖子: 7
注册时间: 2016-10-09 8:53
系统: ubuntu13.10

ubuntu13.10通过执行shell脚本来设置静态ip地址

#1

帖子 zyjimo123 » 2016-11-08 10:00

现在我想通过远程写一个shell脚本来设置ubuntu13.10的静态ip地址,请问该怎么实现呢?如果有的话麻烦把shell脚本贴出来我学学
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: ubuntu13.10通过执行shell脚本来设置静态ip地址

#2

帖子 vickycq » 2016-11-08 10:20

zyjimo123 写了:通过远程写一个shell脚本
建议详细描述此处需求
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
zyjimo123
帖子: 7
注册时间: 2016-10-09 8:53
系统: ubuntu13.10

Re: ubuntu13.10通过执行shell脚本来设置静态ip地址

#3

帖子 zyjimo123 » 2016-11-08 10:22

我通过ssh连接到ubuntu,然后写一个shell脚本,通过执行shell脚本来设置ubuntu的静态ip地址
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: ubuntu13.10通过执行shell脚本来设置静态ip地址

#4

帖子 vickycq » 2016-11-08 11:38

zyjimo123 写了:我通过ssh连接到ubuntu,然后写一个shell脚本
猜测 目前您手上有若干台机器,打算通过脚本批量设置其 ip 地址。是这样么?
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
zyjimo123
帖子: 7
注册时间: 2016-10-09 8:53
系统: ubuntu13.10

Re: ubuntu13.10通过执行shell脚本来设置静态ip地址

#5

帖子 zyjimo123 » 2016-11-08 12:30

vickycq 写了:
zyjimo123 写了:我通过ssh连接到ubuntu,然后写一个shell脚本
猜测 目前您手上有若干台机器,打算通过脚本批量设置其 ip 地址。是这样么?
是的
头像
vickycq
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
联系:

Re: ubuntu13.10通过执行shell脚本来设置静态ip地址

#6

帖子 vickycq » 2016-11-08 12:53

zyjimo123 写了:是的
根据目标系统的网络连接方式(即使用何种网络管理器)确定具体做法。
如使用 ifupdown,通过 sed 一类工具处理 /etc/network/interfaces
如使用 NetworkManager,通过 nmcli 设置连接参数
具体做法需根据实际情况变通
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
回复