- 论坛徽章:
- 0
|
请教:FreeBSD下HOW TO多网卡绑定1个IP?
如果在内核中编译进 netgraph应该就不用kldload了
EXAMPLES
This example script creates a fec node, attaches four Ethernet interfaces
to it and sets forwarding method based on IP address:
/usr/sbin/ngctl -f- <<-SEQ
mkpeer fec dummy fec
msg fec0: add_iface "dc0"
msg fec0: add_iface "dc1"
msg fec0: add_iface "dc2"
msg fec0: add_iface "dc3"
msg fec0: set_mode_inet
SEQ
然后就是把网卡设置成混杂模式
- ifconfig fec0 promisc #虚拟网卡
- ifconfig dc0 promisc #NO.1 真实网卡
- ifconfig dc1 promisc #NO.2 真实网卡
- ifconfig dc2 promisc #NO.3 真实网卡
- ifconfig dc3 promisc #NO.4 真实网卡
复制代码
然后给虚拟网卡ip
- ifconfig fec0 inet 192.168.7.25 up
复制代码 |
|