linux下更改ip、网关

1、SUSE10

 

ip和子网掩码:

 

soa-lab-server01:~ # vi /etc/sysconfig/network/ifcfg-eth-id-00/:14/:22/:19/:bd/:7b BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='221.123.173.12' MTU='' NAME='Dell 82541GI/PI Gigabit Ethernet Controller' NETMASK='255.255.255.192' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' UNIQUE='rBUF.bBSepP2NetB' USERCONTROL='no' _nm_name='bus-pci-0000:06:07.0'

 

网关:

 

soa-lab-server01:~ # vi /etc/sysconfig/network/routes default 221.123.173.1 - -

 

2、Red Hat AS4

 

ip和子网掩码:

 

[root@DEV-191 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 BOOTPROTO=static BROADCAST=172.20.23.255 HWADDR=00:30:48:25:5A:81 IPADDR=172.20.16.191 NETMASK=255.255.248.0 NETWORK=172.20.16.0 ONBOOT=yes TYPE=Ethernet

 

网关:

[root@Dev-869 sysconfig]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=Dev-869 GATEWAY=221.123.173.1

 

你可能感兴趣的:(linux下更改ip、网关)