Linux下搭建网桥后,主机不能上网。

Elliot00 2014-08-18 09:32:10
现在有一台电脑有四个网卡(实际只用前三个),在eth0 和 eth1之间搭建一个网桥,并将eth0和eth1设为了混杂模式。将网卡eth2配置内网ip,用来上传数据。(PS.网络这方面不是太懂,主要是按着学长学姐留下的用户手册配置的)。
外网接入eth0.但是结果是用别的电脑连接eth1可以正常联网,但是主机却无法联网。折腾好几天了,求指导。

...全文
1125 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 4 楼 xiaopeng0824 的回复:
可能因为是校内外才会有IPV6的地址,但是我没有用IPV6= =。我也不知道为什么会显示那个地址,可能是自动获取的把。 因为这台电脑有四个网卡,,是四个物理网卡,并提供了四个接口,所以就可以用别的电脑链接eth1了。
universities usually have better IT infrastructure, fiber cables, ipv6... :) You will have to check the config file of ur nics to figure out if they were configured with dhcp. I noticed that ur eth0, which is supposed to use bridge br0, has a valid ipv6 ip that is as same as the bridge. Did you comment out IPADDR in eth0's config file? Did you declare BRIDGE=br0 in the config file of eth0? Use this link as your refernce: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/s2-networkscripts-interfaces_network-bridge.html
Elliot00 2014-08-18
  • 打赏
  • 举报
回复
可能因为是校内外才会有IPV6的地址,但是我没有用IPV6= =。我也不知道为什么会显示那个地址,可能是自动获取的把。 因为这台电脑有四个网卡,,是四个物理网卡,并提供了四个接口,所以就可以用别的电脑链接eth1了。
  • 打赏
  • 举报
回复
引用 2 楼 xiaopeng0824 的回复:
[quote=引用 1 楼 micropentium6 的回复:] kind of complicated here. explain why you set up eth0 and eth1 on the same subnet? Bridge network for what? Other machine, so you configure this one as the gateway?
是这样的,我是要搭建一个入侵检测系统大致与snort类似,在这台主机上搭建一个透明网桥,eth0连接外网,eth1连接其他电脑。 在这台主机上需要截获数据包分析并上传,但是不知道为什么,配置完后,主机不能上网,但是连接eth1的电脑可以正常上网. 下面是一些相关信息 root@botwall:/botwall/script# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.4.1 0.0.0.0 UG 0 0 0 eth0 192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2 192.168.4.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0 root@botwall:/botwall/script# ifconfig br0 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e2 inet6 addr: fe80::ae22:bff:fe8a:a0e2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37187 errors:0 dropped:186 overruns:0 frame:0 TX packets:33 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2524073 (2.4 MiB) TX bytes:5209 (5.0 KiB) eth0 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e2 inet6 addr: fe80::ae22:bff:fe8a:a0e2/64 Scope:Link UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 RX packets:61540 errors:0 dropped:31 overruns:0 frame:0 TX packets:16038 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11435892 (10.9 MiB) TX bytes:3346728 (3.1 MiB) Interrupt:16 Memory:dc400000-dc420000 eth1 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e3 inet6 addr: fe80::ae22:bff:fe8a:a0e3/64 Scope:Link UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 RX packets:15557 errors:0 dropped:0 overruns:0 frame:0 TX packets:48461 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3304050 (3.1 MiB) TX bytes:9401143 (8.9 MiB) Interrupt:17 Memory:dc300000-dc320000 eth2 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e4 inet addr:192.168.4.254 Bcast:192.168.4.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:18 Memory:dc200000-dc220000 eth3 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e5 UP BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:19 Memory:dc100000-dc120000 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:325 errors:0 dropped:0 overruns:0 frame:0 TX packets:325 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:30678 (29.9 KiB) TX bytes:30678 (29.9 KiB) [/quote] I think I probably can't help u here coz I never set up any ipv6. eth1连接其他电脑。 how do you connect other machine with this one through eth1? Does nic with ipv6 need their own gateway?
Elliot00 2014-08-18
  • 打赏
  • 举报
回复
引用 1 楼 micropentium6 的回复:
kind of complicated here. explain why you set up eth0 and eth1 on the same subnet? Bridge network for what? Other machine, so you configure this one as the gateway?
是这样的,我是要搭建一个入侵检测系统大致与snort类似,在这台主机上搭建一个透明网桥,eth0连接外网,eth1连接其他电脑。 在这台主机上需要截获数据包分析并上传,但是不知道为什么,配置完后,主机不能上网,但是连接eth1的电脑可以正常上网. 下面是一些相关信息 root@botwall:/botwall/script# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.4.1 0.0.0.0 UG 0 0 0 eth0 192.168.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2 192.168.4.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0 root@botwall:/botwall/script# ifconfig br0 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e2 inet6 addr: fe80::ae22:bff:fe8a:a0e2/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:37187 errors:0 dropped:186 overruns:0 frame:0 TX packets:33 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:2524073 (2.4 MiB) TX bytes:5209 (5.0 KiB) eth0 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e2 inet6 addr: fe80::ae22:bff:fe8a:a0e2/64 Scope:Link UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 RX packets:61540 errors:0 dropped:31 overruns:0 frame:0 TX packets:16038 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:11435892 (10.9 MiB) TX bytes:3346728 (3.1 MiB) Interrupt:16 Memory:dc400000-dc420000 eth1 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e3 inet6 addr: fe80::ae22:bff:fe8a:a0e3/64 Scope:Link UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1 RX packets:15557 errors:0 dropped:0 overruns:0 frame:0 TX packets:48461 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3304050 (3.1 MiB) TX bytes:9401143 (8.9 MiB) Interrupt:17 Memory:dc300000-dc320000 eth2 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e4 inet addr:192.168.4.254 Bcast:192.168.4.255 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:18 Memory:dc200000-dc220000 eth3 Link encap:Ethernet HWaddr ac:22:0b:8a:a0:e5 UP BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:19 Memory:dc100000-dc120000 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:325 errors:0 dropped:0 overruns:0 frame:0 TX packets:325 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:30678 (29.9 KiB) TX bytes:30678 (29.9 KiB)
  • 打赏
  • 举报
回复
kind of complicated here. explain why you set up eth0 and eth1 on the same subnet? Bridge network for what? Other machine, so you configure this one as the gateway?
刘杰克 2014-08-18
  • 打赏
  • 举报
回复
怎么感觉eth2没用到啊。br0配置好IP,网关应该就可以上网了

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧