Solved

DHCP on subinterface in FreeBSD

Posted on 2004-03-30
4
1,274 Views
Last Modified: 2013-12-23
Ok, this might be a yes or no question.  I am running FreeBSD 5.2-Release on a home box as a Cable Router/NAT Gateway.  My question is whether or not I can use DHCP on a sub-interface (alias interface).

I added this
ifconfig_de0="DHCP"
ifconfig_de0_alias0="DHCP"

to my rc.conf but when I do a "ifconfig" I don't see it at all, just the actuall interface and no aliases.
#ifconfig
de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::2c0:f0ff:fe37:8720%de0 prefixlen 64 scopeid 0x1
        inet 67.*.*.* netmask 0xffffff80 broadcast 255.255.255.255
        ether 00:c0:f0:37:87:20
        media: Ethernet autoselect (10baseT/UTP)
        status: active
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        options=b<RXCSUM,TXCSUM,VLAN_MTU>
        inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::250:daff:fe1c:311d%xl0 prefixlen 64 scopeid 0x2
        inet 192.168.1.100 netmask 0xffffffff broadcast 192.168.1.255
        ether 00:50:da:1c:31:1d
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4

I am running NATD on the internal interface (xl0) and de0 is the external interface.
What I am wanting to do is

real_ip1 -----
                   \                                                                ---- LAPTOP
                    \                                                             /
                     -----   BSDBOX                                       /
                     -----   acting as router  ----- SWITCH -----
                    /                                                            \
                   /                                                              \
real_ip2 -----                                                                 ---- DESKTOP

Ok... This is what I want it to look like.  But I would like for "real_ip1" to go to BSDBOX, which it does now...  "real_ip2" I would like on a subinterface on the same NIC as "real_ip1".   If somebody were to come in via "real_ip1" it would go to the BSDBOX, "real_ip1" would also be used for NAT for the Laptop.  If somebody were to come in via real_ip2 I would like the BSDBOX to basically forward everything from that IP directly to DESKTOP (basically DMZ).

Is all this fiasco possible?  At this point my road block is getting the DHCP on the subinterface.  But if the rest of the setup isn't possible I am not going to continue to try to get it working.

Thank You
Richard Marriner
richard at syix dot com
0
Comment
Question by:rmarriner
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Alf666
ID: 10717720
DHCP is a "cable based" protocol. It sends a request on a broadcast UDP addr and listens for packets coming back on the medium.

The IP addr is given to you by refering your ethernet addr.

As your alias interface is on the same medium as your main interface, it will never get a second address from a DHCP server.
0
 

Author Comment

by:rmarriner
ID: 10717768
So if I were to add another NIC (which would make three...) in theory this would work?
0
 
LVL 9

Accepted Solution

by:
Alf666 earned 125 total points
ID: 10718006
Not only in theory. Practically also, yes. But I don't really see the advantage.
0
 

Author Comment

by:rmarriner
ID: 10718352
Thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now