安装net-tools包
因为其余机器没有网络,使用rpm包安装,并添加缺省路由。
[root@web1 base]# tree . ├── add-route.sls ├── files │ └── net-tools-2.0-0.22.20131004git.el7.x86_64.rpm └── set-hostname.sls [root@web1 base]# cat add-route.sls cprpm: file.managed: - source: salt://files/net-tools-2.0-0.22.20131004git.el7.x86_64.rpm - name: /opt/net-tools-2.0-0.22.20131004git.el7.x86_64.rpm cmd.run: - name: rpm -ivh /opt/net-tools-2.0-0.22.20131004git.el7.x86_64.rpm - unless: rpm -qa |grep net-tool rouadd: cmd.run: - name: route add default gw 10.1.1.1 10.1.1.1 为我的网关。 做NAT代理上网 批量执行 [root@web1 base]# salt-ssh '*' state.sls add-route