亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 單網(wǎng)卡 多ip 網(wǎng)橋設(shè)置 [打印本頁]

作者: hinetworking    時(shí)間: 2013-07-12 12:22
標(biāo)題: 單網(wǎng)卡 多ip 網(wǎng)橋設(shè)置
系統(tǒng)ubuntu  能做到嗎?
配置單網(wǎng)卡多ip時(shí):
auto eth0:0
iface eth0:0 inet static
    address 192.168.100.15
    netmask 255.255.128.0
    dns-nameservers 192.168.0.97


auto eth0:1
iface eth0:1 inet static
    address 10.10.100.1
    netmask 255.255.255.0
兩個(gè)ip都能使用

我一旦配置網(wǎng)橋后:
auto eth0:0
iface eth0:0 inet static
    address 192.168.100.15
    netmask 255.255.128.0
    dns-nameservers 192.168.0.97

auto br1
iface br1 inet static
    bridge_ports eth0:1
    address 10.10.100.1
    netmask 255.255.255.0
服務(wù)器就不能ping通同網(wǎng)段的192.168.100.16了,
求教,單網(wǎng)卡如何配置多ip,如何配置網(wǎng)橋

作者: GB_juno    時(shí)間: 2013-07-13 14:10
先建網(wǎng)橋
auto br1
iface br1 inet static
        bridge_ports eth0
        bridge_stp off
再按照普通網(wǎng)卡的方式配置br1:0和br1:1。
auto br1:0
iface br1:0 inet static
    address 192.168.100.15
    netmask 255.255.128.0
    dns-nameservers 192.168.0.97
作者: hinetworking    時(shí)間: 2013-07-15 11:03
本帖最后由 hinetworking 于 2013-07-15 11:11 編輯

auto br0
iface br0 inet static
    bridge_ports eth0
    bridge_stp off

auto br0:0
iface br0:0 inet static
    address 192.168.100.15
    netmask 255.255.128.0
    dns-nameservers 192.168.0.97

auto br0:1
iface br0:1 inet static
    address 10.10.100.1
    netmask 255.255.255.0

我如上配置后,重啟網(wǎng)絡(luò),得到如下信息:
Missing required variable: address
Missing required configuration variables for interface br0/inet.
Failed to bring up br0.
Cannot find device "br0:0"
Failed to bring up br0:0.
Cannot find device "br0:1"
Failed to bring up br0:1.


查看網(wǎng)絡(luò),如下:
eth0      Link encap:Ethernet  HWaddr e0:db:55:07:e1:70
          inet6 addr: fe80::e2db:55ff:fe07:e170/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:330716 errors:0 dropped:0 overruns:0 frame:0
          TX packets:249609 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31917792 (31.9 MB)  TX bytes:25359245 (25.3 MB)
          Interrupt:35

eth0:0    Link encap:Ethernet  HWaddr e0:db:55:07:e1:70
          inet addr:192.168.100.15  Bcast:192.168.127.255  Mask:255.255.128.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:35

eth0:1    Link encap:Ethernet  HWaddr e0:db:55:07:e1:70
          inet addr:10.10.100.1  Bcast:10.10.100.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:35

網(wǎng)橋沒有配置好,相當(dāng)于多ip了


請問,該怎么修正?

回復(fù) 2# GB_juno


   
作者: GB_juno    時(shí)間: 2013-07-15 14:53
你把原來的eth0:0和eth0:1的相關(guān)配置刪除..
先創(chuàng)建網(wǎng)橋br0.這個(gè)需要預(yù)裝工具bridge_utils
apt-get install bridge_utils
創(chuàng)建網(wǎng)橋br0
brctl addbr br0
把網(wǎng)卡連到網(wǎng)橋
brctl addif br0 eth0
然后配置好br0:0和br0:1就可以了
作者: hinetworking    時(shí)間: 2013-07-15 16:45
我試了一下,還是不行,我覺得是網(wǎng)橋不支持這種虛擬網(wǎng)卡(eth0:0)的原因吧
多謝指導(dǎo),也學(xué)到了不少
回復(fù) 4# GB_juno


   
作者: GB_juno    時(shí)間: 2013-07-15 18:06
我確定redhat是可以這樣做的,因?yàn)槲业姆⻊?wù)器就這樣弄的。ubuntu應(yīng)該是差不多的吧
作者: hinetworking    時(shí)間: 2013-07-16 09:44
本帖最后由 hinetworking 于 2013-07-16 09:53 編輯

將配置全部寫在interface中,
我這么設(shè)置過,之前失敗,配置文件interface的內(nèi)容和錯(cuò)誤消息上次發(fā)給您短消息了
后來,照您的提示
先將eth0加入到網(wǎng)橋中
brctl addbr br0
brctl addif bro eth0
然后再在interface中配置br0:0和br0:1
auto br0:0
iface br0:0 inet static
    address 192.168.100.15
    netmask 255.255.128.0
    dns-nameservers 192.168.0.97

auto br0:1
iface br0:1 inet static
    address 10.10.100.1
    netmask 255.255.255.0
然后還是失敗了,192那個(gè)網(wǎng)段ping不通了
回復(fù) 6# GB_juno


   
作者: GB_juno    時(shí)間: 2013-07-16 10:27
本帖最后由 GB_juno 于 2013-07-16 10:30 編輯

回復(fù) 7# hinetworking


哥們,之前沒有收到你的短消息,我剛看了兩遍..
你把eth0:0和eth0:1先ifdown一下,在配置文件里面只需要把br0配置。
  1. auto lo
  2. iface lo inet loopback

  3. auto eth0
  4. iface eth0 inet manual

  5. auto br0
  6. iface br0 inet static
  7.   bridge_ports eth0
  8.   bridge_stp off
  9.   bridge_fd 0
  10.   bridge_maxwait 0
復(fù)制代碼
重啟網(wǎng)絡(luò)

  1. /etc/init.d/networking restart
復(fù)制代碼
ifconfig看看有哪些網(wǎng)卡信息以及br0網(wǎng)橋在不在。
如果br0網(wǎng)橋起來了,使用ifconfig命令直接配置網(wǎng)橋br0:0和br0:1,當(dāng)然這樣的操作肯定是臨時(shí)的,重啟后消失
  1. sudo ifconfig br0:0 192.168.100.15 netmask 255.255.128.0 up
  2. sudo ifconfig br0:1 10.10.100.1 netmask 255.255.255.0 up
復(fù)制代碼
先看看手動(dòng)配置能不能通吧。
作者: hinetworking    時(shí)間: 2013-07-16 13:36
配置文件這么寫的話,報(bào)錯(cuò):
missing required variable:address
missing required configuration variable for interface br/inet
Failed to bring up br0

當(dāng)然執(zhí)行配置網(wǎng)橋br0:0 和 br0:1 命令的話,就提示:no such device
然后我手動(dòng)加建立起br0

輸入命令:
brctl addbr br0
brctl addif br0 eth0

再執(zhí)行配置網(wǎng)橋br0:0和br0:1的命令,沒有ping通


回復(fù) 8# GB_juno


   
作者: GB_juno    時(shí)間: 2013-07-16 14:20
直接用ifconfig配也不行..這個(gè)有點(diǎn)坑
網(wǎng)橋多IP就應(yīng)該這樣搞才對..我找臺ubuntu試試。
作者: hinetworking    時(shí)間: 2013-07-16 16:20
   可以嗎
回復(fù) 10# GB_juno


   
作者: GB_juno    時(shí)間: 2013-07-16 16:54
就按照我的方法做是可以的,實(shí)驗(yàn)過了,你看看附件,樓層貼圖麻煩。

1.JPG (38.05 KB, 下載次數(shù): 52)

ubuntu配置

ubuntu配置

2.JPG (0 Bytes, 下載次數(shù): 47)

兩個(gè)ip地址都能通

兩個(gè)ip地址都能通

作者: GB_juno    時(shí)間: 2013-07-16 16:58
先建網(wǎng)橋

  1. brctl addbr br0
  2. brctl addif br0 eth0
復(fù)制代碼
改配置文件,按照圖1改
重啟網(wǎng)絡(luò)

  1. /etc/init.d/networking restart
復(fù)制代碼
然后ifconfig就能看到3張?zhí)摂M網(wǎng)卡出現(xiàn):br0、br0:0、br0:1
作者: hinetworking    時(shí)間: 2013-07-16 22:55
多謝GB_juno,我試試
GB_juno 發(fā)表于 2013-07-16 16:58
先建網(wǎng)橋改配置文件,按照圖1改
重啟網(wǎng)絡(luò)然后ifconfig就能看到3張?zhí)摂M網(wǎng)卡出現(xiàn):br0、br0:0、br0:1





歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2