help:: configuring two network interfaces--message->>ifconfig: ioctl (SIOCAIFADDR): File exists

Vladimir Grebenschikov vova at fbsd.ru
Tue Sep 7 01:39:49 PDT 2004


В вт, 07/09/2004 в 10:38 +0300, Dmitriy V. Andrushko пишет:
> >  ifconfig_rl1="inet 192.168.10.1  netmask 255.255.255.0"
> >  ifconfig_rl0="inet 192.168.10.2  netmask 255.255.255.0"
> 
>  You can't have two network interfaces on the same subnet. You can
> configure your net next way:
> ifconfig_rl1="inet 192.168.10.1  netmask 255.255.255.0"
> ifconfig_rl0="inet 192.168.20.1  netmask 255.255.255.0"


Actually you can

# ifconfig ndis0 10.111.0.1/24
# route delete 10.111.0.0/24
delete net 10.111.0.0
# ifconfig fxp0 10.111.0.2/24
# ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000 
fxp0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu
1500
        options=8<VLAN_MTU>
        inet 10.111.0.2 netmask 0xffffff00 broadcast 10.111.0.255
        ether 08:00:46:c8:45:b3
        media: Ethernet autoselect (100baseTX)
        status: active
ndis0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.111.0.1 netmask 0xffffff00 broadcast 10.111.0.255
        ether 00:0e:35:03:82:74
        media: IEEE 802.11 Wireless Ethernet autoselect
        status: no carrier
        ssid ""
        channel -1 authmode OPEN powersavemode OFF powersavesleep 100
        rtsthreshold 2312 protmode CTS
        wepmode OFF weptxkey 1

But you should select what target interface will be for routing to this
subnet, in my example, after configuration of ndis0, I have removed
route of subnet 10.111.0.0/24 to this interface, and then add address
and routing to subnet on fxp0 interface.

now expecting routing table:

# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif
Expire
10.111/24          link#2             UC          0        0   fxp0
127.0.0.1          127.0.0.1          UH          1      756    lo0


We see, subnet routed to fxp0, but ndis0 still can receive traffic as
configured.

But such configuration is very specific, and you should very understand
what you do.

-- 
Vladimir B. Grebenchikov
vova at fbsd.ru


More information about the freebsd-net mailing list