RHEL5下一个网卡绑定多个IP

 

 

首页Linux教程

背景:

阅读新闻

RHEL5下一个网卡绑定多个IP

[日期:2010-05-08]   来源:月牙天冲  作者:naruto6006   [字体:]  

在Windows下,一个网卡可以绑定多个IP地址,只要在网卡的“TCP/IP属性”的“高级”选项中添加具体的IP地址就可以实现了,那么在Linux字符环境下又是如何实现的呢!下面就来介绍下操作步骤:

[root@ns1 ~]# cd /etc/sysconfig/network-scripts/

[root@ns1 network-scripts]# ls
ifcfg-eth0    ifdown-isdn    ifup-aliases ifup-plip    ifup-wireless
ifcfg-lo      ifdown-post    ifup-bnep     ifup-plusb   init.ipv6-global
ifdown        ifdown-ppp     ifup-eth      ifup-post    net.hotplug
ifdown-bnep   ifdown-routes ifup-ippp     ifup-ppp     network-functions
ifdown-eth    ifdown-sit     ifup-ipsec    ifup-routes network-functions-ipv6
ifdown-ippp   ifdown-sl      ifup-ipv6     ifup-sit
ifdown-ipsec ifdown-tunnel ifup-ipx      ifup-sl
ifdown-ipv6   ifup           ifup-isdn     ifup-tunnel


[root@ns1 network-scripts]# cp ifcfg-eth0 ifcfg-eth0:1

[root@ns1 network-scripts]# vi ifcfg-eth0:1

# Digital Equipment Corporation DECchip 21140 [FasterNet]
DEVICE=eth0:1
BOOTPROTO=static
HWADDR=00:03:FF:43:1A:B9
ONBOOT=yes
IPADDR=192.168.0.30
NETMASK=255.255.255.0

[root@ns1 network-scripts]# cd
[root@ns1 ~]# service network restart
Shutting down interface eth0:                              [ OK ]
Shutting down loopback interface:                          [ OK ]
Bringing up loopback interface:                            [ OK ]
Bringing up interface eth0:                                [ OK ]

[root@ns1 ~]# ifconfig
eth0      Link encap:Ethernet HWaddr 00:03:FF:43:1A:B9
          inet addr:192.168.0.20 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::203:ffff:fe43:1ab9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:9137 errors:11 dropped:0 overruns:0 frame:0
          TX packets:7251 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:775430 (757.2 KiB) TX bytes:905855 (884.6 KiB)
          Interrupt:11 Base address:0x6000

eth0:1    Link encap:Ethernet HWaddr 00:03:FF:43:1A:B9
          inet addr:192.168.0.30 Bcast:192.168.0.255 Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:11 Base address:0x6000

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:116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10687 (10.4 KiB) TX bytes:10687 (10.4 KiB)

体验Ubuntu 10.04 LTS感受[多图]

基于Ubuntu 10.04上的CVS+Eclipse配置

相关资讯       RHEL 

   

本文评论   查看全部评论 (0)


评论声明

尊重网上道德,遵守中华人民共和国的各项有关法律法规

承担一切因您的行为而直接或间接导致的民事或刑事法律责任

本站管理人员有权保留或删除其管辖留言中的任意内容

本站有权在网站内转载或引用您的评论

参与本评论即表明您已经阅读并接受上述条款

 

 

 

最新资讯

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/27015.html