4个回答
展开全部
!#/bin/bash
ifconfig eth0 x.x.x.x netmask x.x.x.x up #立即生效
ipconf = "/etc/sysconfig/network-scripts/ifcfg-eth0"
echo "DEVICE=eth0" > $ipconf
echo "ONBOOT=yes" > $ipconf
echo "BOOTPROTO=static" > $ipconf
echo "IPADDR=192.168.0.117" > $ipconf
echo "NETMASK=255.255.255.0" > $ipconf
echo "GATEWAY=192.168.0.254" > $ipconf
echo "service network restart" > $ipconf
ifconfig eth0 x.x.x.x netmask x.x.x.x up #立即生效
ipconf = "/etc/sysconfig/network-scripts/ifcfg-eth0"
echo "DEVICE=eth0" > $ipconf
echo "ONBOOT=yes" > $ipconf
echo "BOOTPROTO=static" > $ipconf
echo "IPADDR=192.168.0.117" > $ipconf
echo "NETMASK=255.255.255.0" > $ipconf
echo "GATEWAY=192.168.0.254" > $ipconf
echo "service network restart" > $ipconf
展开全部
直接用
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
或者在 /etc/sysconfig/network-scripts/ifcfg-eth0里直接修改eth0 IP,然后 service network restart
ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up
或者在 /etc/sysconfig/network-scripts/ifcfg-eth0里直接修改eth0 IP,然后 service network restart
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
!#/bin/bash
ifconfig eth0 x.x.x.x netmask x.x.x.x up
ifconfig eth0 x.x.x.x netmask x.x.x.x up
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
vi /etc/sysconfig/network-scripts/ifcfg-eth0
------------------------------
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.117
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
-------------------------------
service network restart
------------------------------
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.117
NETMASK=255.255.255.0
GATEWAY=192.168.0.254
-------------------------------
service network restart
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询