如何在同一个网卡邦定2个不同子网的ip[6]

[入库:2005年9月19日] [更新:2007年3月24日]

本文简介:

若 route table 沒有具體 destination 的 routing , 那就使用 default .
然而, 在一般的 routing 下(不是運用 adv-routing), 
就算你設了多個 default gw, 那只能使用一個而已.
這部份上次給你的 link 有說明, 不知你看了沒有?

4) switching 技術與 routing 是不一樣的.
若你指的是 L2 switch , 你根本不要為 routing 操心, 因為那與 L2 無關.
若你指的是 L3 switch, 那你同樣也不必為 routing 操心, 因為 switch 會跟據 destination 決定如何轉送...

---
從問題的提出及組織來看, 你似乎對 OSI 的分層概念還不很清楚.
或許, 先不要急著理解當前的疑問, 先好好的將 OSI 及 ip routing 這些基本概念溫習一下.
若你需要書單的話, 可參考:
http://www.study-area.org/tips/net_books.htm

---
p.s.
若對 linux 的 multi-routing 實作感興趣的話, 
可以參考:
http://phorum.study-area.org/viewtopic.php?t=10085

 jzcjy 回复于:2004-07-30 03:34:48 [quote:296bb3ba6d="jgkc"]squid 没有怎么用过, 
vlan控制不是很容易吗?也能控制,那mac就不用了吧?

两个网段掩码都是24的A类网址能实现吧, 我刚试了的:
inet 10.78.12.2/24 brd 10.255.255.255 scope global eth0:1
    inet 10.78.11.2..........[/quote:296bb3ba6d]
jgkc      
兄弟你的贴子
http://bbs.chinaunix.net/forum/viewtopic.php?t=362947&highlight=jgkc
最后是如何搞定的?

 wingger 回复于:2004-07-30 09:09:55 [quote:4e5472bc9d="網中人"]
1) 子網是 L3 的東西, NIC 是 L1 的東東, 若用 ethernet (802.3) 那是 L2 的東東.
OSI 的分層目的就是在於"分工合作", 若你這裡談 subnet, 只要分好且底層 L2/L1 連得上, 
那就行了... 不必管底下的 L2/L1 是同一..........[/quote:4e5472bc9d]

谢谢各位解答,讨论再讨论下去,楼主有意见了

其实我一直不解的是这个问题的

[url]http://bbs.chinaunix.net/forum/viewtopic.php?p=2508258#2508258[/url]

 cnzxy 回复于:2004-07-30 10:58:54 可以的。我配置成功了。用route命令配置路由即可。

 jgkc 回复于:2004-07-30 10:59:23 [quote:f8e3a4ab3a="jzcjy"]
jgkc      
兄弟你的贴子
http://bbs.chinaunix.net/forum/viewtopic.php?t=362947&highlight=jgkc
最后是如何搞定的?[/quote:f8e3a4ab3a]

这个问题呀,还是没有搞定.
1. 变通了一下,想修改接口的时候,就把另外一个ip去掉,然后再修改接口ip,然后再添加另外的ip, 呵呵, 没有办法的办法
2. 这个问题已经提交到了 bugzilla.redhat.com 正在解决中.
有兴趣的话关注一下:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=128770

 網中人 回复于:2004-07-30 13:45:51 [quote:32f1528e05="wingger"]谢谢各位解答,讨论再讨论下去,楼主有意见了 

其实我一直不解的是这个问题的 

http://bbs.chinaunix.net/forum/viewtopic.php?p=2508258#2508258[/quote:32f1528e05]
樓主不見得會有意見... ^_^

關於 multipath, 請參考:
http://phorum.study-area.org/viewtopic.php?t=10085
http://www.study-area.org/tips/multipath.htm

 網中人 回复于:2004-07-30 13:52:20 [quote:b6b419c0e1="jgkc"]

这个问题呀,还是没有搞定.
1. 变通了一下,想修改接口的时候,就把另外一个ip去掉,然后再修改接口ip,然后再添加另外的ip, 呵呵, 没有办法的办法
2. 这个问题已经提交到了 bugzilla.redhat.com 正在解决中.
有兴?.........[/quote:b6b419c0e1]
如下是我在 rh9.0 的測試:
[code:1:b6b419c0e1]
[root@pc2 root]# ifdown eth2
[root@pc2 root]# ip addr show eth2
4:; eth2:; <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:;02:;b3:;4b:;69:;49 brd ff:;ff:;ff:;ff:;ff:;ff
[root@pc2 root]# ip addr add dev eth2 1.1.2.3/24
[root@pc2 root]# ip addr show eth2
4:; eth2:; <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:;02:;b3:;4b:;69:;49 brd ff:;ff:;ff:;ff:;ff:;ff
    inet 1.1.2.3/24 scope global eth2
[root@pc2 root]# ip addr add dev eth2 1.1.2.8/32
[root@pc2 root]# ip addr show eth2
4:; eth2:; <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:;02:;b3:;4b:;69:;49 brd ff:;ff:;ff:;ff:;ff:;ff
    inet 1.1.2.3/24 scope global eth2
    inet 1.1.2.8/32 scope global eth2[/code:1:b6b419c0e1]

此外, 你在 redhat bugzilla 提到的 my expected results is :

本文关键:如何在同一个网卡邦定2个不同子网的ip
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top