2010-3-31
-
配置
Redhat 5
透明网桥
2010-03-31 20:54:19
近期因环境需要,需要搭建一个透明网桥
(实验环境)。
环境准备:
虚拟机两台:
xp一台,RHEL5.4 一台(其中RHEL拥有双网卡)
因为要实验透明网桥,所以连接方式为:
XP-----eth0----eth1----桥接
实际连接如下图:
网络地址:
1、
Windows xp的网卡地址为192.168.1.10
2、
Redhat双网卡不设置IP地址或为0.0.0.0均可,因为在配置为混杂模式时,会清掉IP地址。
3、物理机的
IP为192.168.1.189
最终实现的目的为物理机可以与虚拟机XP正常通信
。
OK,开工吧!整个过程以简单记录为主!
首先需要安装网桥包。
[root@redhat5 ~]#
rpm -ivh bridge-utils-1.1-2.i386.rpm
安装好后,我们就开始进行设置吧!
[root@redhat5 ~]#
brctl addbr br0
(br0为网桥名称)
[root@redhat5 ~]# brctl addif br0 eth0
[root@redhat5 ~]# brctl addif br0 eth1
把 eth0和eth1都加到桥中。
[root@redhat5 ~]# ifconfig eth0 down
[root@redhat5 ~]# ifconfig eth1 down
[root@redhat5 ~]# ifconfig eth0 0.0.0.0 up
[root@redhat5 ~]# ifconfig eth1 0.0.0.0 up ( 如果这两条命令不生效,就可以使用以下两条命令,将网卡工作于混杂模式下)
[root@redhat5 ~]# brctl addif br0 eth0
[root@redhat5 ~]# brctl addif br0 eth1
把 eth0和eth1都加到桥中。
[root@redhat5 ~]# ifconfig eth0 down
[root@redhat5 ~]# ifconfig eth1 down
[root@redhat5 ~]# ifconfig eth0 0.0.0.0 up
[root@redhat5 ~]# ifconfig eth1 0.0.0.0 up ( 如果这两条命令不生效,就可以使用以下两条命令,将网卡工作于混杂模式下)
[root@redhat5 ~]#
ifconfig eth0 0.0.0.0 promisc
[root@redhat5 ~]# ifconfig eth1 0.0.0.0 promisc
[root@redhat5 ~]# ifconfig eth1 0.0.0.0 promisc
[root@redhat5 ~]#
service network restart
OK,测试成功以后。为了让其重启后可以生效,我们需要编辑其相关的配置文档。
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth1
/etc/sysconfig/network-scripts/ifcfg-br0
最后重启网络服务,保存即可!
最终结果是虚拟机
XP与物理机正常通信。
冰冻这么久,第一次写
LINUX文章,加油!
2010-3-31 深圳
转载于:https://blog.51cto.com/1237448/485420
本文详细介绍了如何在Redhat 5.4系统上搭建透明网桥,并通过实验环境验证了物理机与虚拟机之间的正常通信。主要内容包括安装网桥包、配置网卡以及编辑相关配置文件。
3873

被折叠的 条评论
为什么被折叠?



