1. 能否给一个网卡配置多个IP? 如果能,怎么配置?
[root@web ~]# cd /etc/sysconfig/network-scripts
[
root@web network-scripts]# ls
i
fcfg-eth0 ifdown-sit ifup-post
ifcfg-lo ifdown-tunnel ifup-ppp
ifdown ifup ifup-routes
ifdown-bnep ifup-aliases ifup-sit
ifdown-eth ifup-bnep ifup-tunnel
ifdown-ippp ifup-eth ifup-wireless
ifdown-ipv6 ifup-ippp init.ipv6-global
ifdown-isdn ifup-ipv6 net.hotplug
ifdown-post ifup-isdn network-functions
ifdown-ppp ifup-plip network-functions-ipv6
ifdown-routes ifup-plusb
[root@web network-scripts]# cp ifcfg-eth0 ifcfg-eth0:0
[
root@web network-scripts]# ls
ifcfg-eth0 ifdown-routes ifup-plusb
ifcfg-eth0:0 ifdown-sit ifup-post
ifcfg-lo ifdown-tunnel ifup-ppp
ifdown ifup ifup-routes
ifdown-bnep ifup-aliases ifup-sit
ifdown-eth ifup-bnep ifup-tunnel
ifdown-ippp ifup-eth ifup-wireless
ifdown-ipv6 ifup-ippp init.ipv6-global
ifdown-isdn ifup-ipv6 net.hotplug
ifdown-post ifup-isdn network-functions
ifdown-ppp ifup-plip network-functions-ipv6
[root@web network-scripts]#
[root@web network-scripts]# cat ifcfg-eth0:0 改一下Ip地址就可以了!
DEVICE="eth0:0"
BOOTPROTO="static"
HWADDR="00:0C:29:25:8F:70"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="e4db1bf3-34ae-4f29-934d-f03beecb3154"
IPADDR=192.168.0.220
NETMASK=255.255.255.0
#GATEWAY=192.168.0.1
DNS1=8.8.8.8
DNS2=202.103.224.68
DNS3=211.138.245.180
[
root@web network-scripts]#
[root@web ~]# /etc/init.d/network restart
[root@web ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:25:8F:70
inet addr:
192.168.0.219 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe25:8f70/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:36413 errors:0 dropped:0 overruns:0 frame:0
TX packets:3922 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2849966 (2.7 MiB) TX bytes:536152 (523.5 KiB)
Interrupt:19 Base address:0x2024
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:25:8F:70
inet addr:
192.168.0.220 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:19 Base address:0x2024
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[
root@web ~]#