Ubuntu:edit /etc/network/interfaces
# The loopback interface auto lo iface lo inet loopback # Configuration for eth0 and aliases # This line ensures that the interface will be brought up during boot. auto eth0 eth0:0 eth0:1 # eth0 - This is the main IP address that will be used for most outbound connections. # The address, netmask and gateway are all necessary. iface eth0 inet static address 66.246.75.77 netmask 255.255.255.0 gateway 66.246.75.1 # eth0:0 iface eth0:0 inet static address 97.107.130.169 netmask 255.255.255.0 # eth0:1 - Private IPs have no gateway (they are not publicly routable) so all you need to # specify is the address and netmask. iface eth0:1 inet static address 192.168.133.234 netmask 255.255.128.0
CentOS:
edit /etc/sysconfig/network-scripts/ifcfg-eth0
edit /etc/sysconfig/network-scripts/ifcfg-eth0
# Configuration for eth0 DEVICE=eth0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0 - This is the main IP address that will be used for most outbound connections. # The address, netmask and gateway are all necessary. IPADDR=66.246.75.77 NETMASK=255.255.255.0 BROADCAST=66.246.75.255 GATEWAY=66.246.75.1
edit /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Configuration for eth0:0 DEVICE=eth0:0 BOOTPROTO=none # This line ensures that the alias will be brought up when the interface is. ONPARENT=yes # eth0:0 IPADDR=97.107.130.169 NETMASK=255.255.255.0 BROADCAST=97.107.130.255 GATEWAY=97.107.130.1
ref: http://www.linode.com/wiki/index.php/Configure_Static_IPs
沒有留言:
張貼留言