DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th November 2014
lars_d lars_d is offline
New User
 
Join Date: Nov 2014
Posts: 3
Default Bind NIC/MAC to interface name

Hello,

I 'am new to openbsd (5.4), I have a little experience with linux and want to make my new firewall with bsd and pf.

Under linux there was the possibility to bind a MAC Address with /etc/udev/rules.d/70-persistent-net.rules to a interface name.

Do you know where I can find this in openbsd or how I can do this?

thank you

kind regards

Lars

Last edited by J65nko; 11th November 2014 at 03:42 AM. Reason: changed inteface to interface :)
Reply With Quote
  #2   (View Single Post)  
Old 10th November 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Hello and welcome to daemonforums!

While I'm anything but an expert on OpenBSD, to the best of my knowledge it's not possible to rename a network interface in the way you ask about. If this seems to be causing a significant difficulty for your application, perhaps if you provided more specific details someone could help you to solve the problem within the available capabilities.
Reply With Quote
  #3   (View Single Post)  
Old 10th November 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by lars_d View Post
Under linux there was the possibility to bind a MAC Address with /etc/udev/rules.d/70-persistent-net.rules to a interface name.
Welcome!

The lladdr option in ifconfig(8) may be what you are searching for...
Quote:
I 'am new to openbsd (5.4)...
Recognize that OpenBSD 5.6 has recently been released 1 November, & with this release, public support for OpenBSD 5.4 has officially ended. You are free to continue using 5.4, but you should have a specific reason for doing so as the community no longer has any public obligation. If you are new to OpenBSD, updating or simply installing version 5.6 now may save you time & aggravation in the long run. More information on OpenBSD's release schedule can be found in Section 5.1 of the official FAQ.

Last edited by ocicat; 10th November 2014 at 06:21 AM. Reason: grammar
Reply With Quote
  #4   (View Single Post)  
Old 10th November 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 653
Default

I will add that under Linux, this can make it problematic when moving a drive to a new machine. For example, in FreeBSD (I realize you're discussing open, but I think it's similar), the name depends upon the brand of NIC, for example, I think Broadcom is bge (I could be wrong, but let's say that's true.) If I move the drive to new hardware, it should boot and any complex network configs should remain in place--if it's a non-Broadcom NIC, I'll rename it from bge0 to whatever.

In contrast, if you move a drive from a RedHat based machine to a new machine, networking will have to be redone in udev and /etc/sysconfig/networking-scripts (or it will create new devices) The binding of the name to the MAC (and, these days, in CentOS and Fedora, at least, a long UUID), is not an advantage to the sysadmin in my less than humble opinion.
Reply With Quote
  #5   (View Single Post)  
Old 10th November 2014
lars_d lars_d is offline
New User
 
Join Date: Nov 2014
Posts: 3
Default

Hi,

thank you for the answers/welcome.

The lladdr option could be a solution, I will check this.

I have the following situation:
3 external Interfaces (MAC/IP) and one to the dmz. All interfaces are from the same manufacturer.
The rules are very different for each interface, I have to be sure that for example fxp3 will be always fxp3.
But if I remove one of these cards, a renumbering will happen.
Example:
If I remove fxp2 than fxp3 will get fxp2 which is not good.

The rules for fxp2 will than be on the interface which should be fxp3 :-(

Maybe I configured something wrong, but in my Openbsd installation the interface names are numbered through hardware order.
Reply With Quote
  #6   (View Single Post)  
Old 10th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Hello, and welcome!
Quote:
Originally Posted by lars_d View Post
Maybe I configured something wrong, but in my Openbsd installation the interface names are numbered through hardware order.
That is how the interfaces are assigned. If you remove one of the NICs in the hardware discovery sequence, renumbering will occur. The infrastructure support team (which, for a small infrastructure, may only be you) needs to be aware, and if physical restructuring is performed, adjustments to network provisioning files may be needed.

We manage this through awareness, through the use of the ifconfig(8) description option in hostname.if(5) files, and through the use of macros in pf.conf(5) and other network provisioning files.

Last edited by jggimi; 10th November 2014 at 01:56 PM. Reason: clarity
Reply With Quote
  #7   (View Single Post)  
Old 10th November 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

The lladdr option of ifconfig is for changing the MAC address. I don't think that's what the OP wanted to do, rather he wanted a given NIC (with a given MAC) to be assigned an interface name of his choice, without that assignment changing under certain hardware changes.

Last edited by IdOp; 10th November 2014 at 05:38 PM. Reason: clarity
Reply With Quote
  #8   (View Single Post)  
Old 10th November 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by IdOp View Post
...rather he wanted a given NIC (with a given MAC) to be assigned an interface name of his choice, without that assignment changing under certain hardware changes.
I agree with you IdOp, as this was born out in subsequent responses. As jggimi has summarized, judicious use of interface groups & how these groups are managed in pf.conf(5) is likely what lars_d needs to further investigate.
Reply With Quote
  #9   (View Single Post)  
Old 10th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

But I didn't recommend interface groups. I should have, but I'd forgotten about them completely.
Reply With Quote
Old 11th November 2014
random_seed random_seed is offline
New User
 
Join Date: Nov 2014
Posts: 1
Default

Hi lars_d,

As Ocicat suggested, I think that the best way to prevent issues with pf and interface renaming is to use the group feature offered by ifconfig(8). You will find all details in the manpage.

But to summarize, this feature allows you to place each of your NIS in one or more groups (ie. dmz, priv, etc), then you just have to use this group name in your pf.conf ruleset instead of the regular interface name.

So it's not exactly the same thing as the Linux relation between the mac address and the OS's interface name, but it's far more powerfull !
I use it everyday in order to easily export my ruleset onto different systems.
Reply With Quote
Old 12th November 2014
lars_d lars_d is offline
New User
 
Join Date: Nov 2014
Posts: 3
Default

Hi,

thanks for the answers and point to group and ifconfig(8). What I read for now is that "the group function" is meant to be to bundle interfaces of a specific type to a group.

Maybe not what I need, because to my shame I have forgot to mention a few facts:

My ISP do provide me static IP's through DHCP with MAC Address conjunction.

So I want to serve two external DNS namesserver with 2 diffrent IP's and also my webserver to the internet with another IP.

All servers are in a DMZ, so my plan was to use as external firewall a bsd machine with 4 interfaces 3 external and one internal (DMZ). But my latest guess was that I will need more internal interface in case of difficult routing or more firewall machines. Another point....

For interface groups:
For me it is still not clear how I can be sure that an interface (for example fxp2) is not exchanged with another MAC/IP due to the fact of renumbering, even if it belongs to a group?

So if MAC/IP 1 on fxp2 belongs to group DNS1 and MAC/IP 2 on fxp3 belogns to group DNS2, how can I be sure that if I remove fxp2 from the machine, that fxp3 will not get fxp2 and belongs than to group DNS1?

OK not a problem if DNS1 and DNS2 provide the same namespace but if not...

Is awareness or the lladdr option the only solution?

Maybe I missed the point in the manpage of ifconfig.

kind regards
Reply With Quote
Old 12th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Quote:
Originally Posted by lars_d View Post
So I want to serve two external DNS namesserver with 2 diffrent IP's and also my webserver to the internet with another IP.
If I understand this, you plan to have at least three external-facing, unique IP addresses, using two NICs and DHCP services from your ISPs. I'm not sure how you would arrive at three IP addresses with two NICs running dhclient(8). Typically you assign multiple addresses to a NIC with the ifconfing(8) alias option, as part of assigning a static base address.
Quote:
All servers are in a DMZ, so my plan was to use as external firewall a bsd machine with 4 interfaces 3 external and one internal (DMZ). But my latest guess was that I will need more internal interface in case of difficult routing or more firewall machines.
Why aren't you deploying switches? You're building networks, you should not need a NIC on your router for every server or workstation attachment. If you happen to use switches that support VLANs (802.1Q), this would allow you to devise logical subnetworks as needed. They could have different quality of service requirements, such as for IPTV or VOIP.

Your idea of two firewalls is fairly common. Those solutions often look something like this:
Code:
{Internet} - [fw1] - [DMZ servers] - [fw2] - [inner servers/workstations]
I would deploy at minimum two switches in that example. 1) Interconnecting the DMZ servers and the two firewalls, and 2) interconnecting fw2 and the inner platforms. Each firewall requires only two NICs. Servers and workstations only require one.
And of course, fw1 would need a static route added to reach the inner subnet. The DMZ servers do not require the route added to their routing tables, but it would reduce traffic on the DMZ if they also had that route added, since they would otherwise have to route their traffic to the inner network through fw1 first.
Quote:
For me it is still not clear how I can be sure that an interface (for example fxp2) is not exchanged with another MAC/IP due to the fact of renumbering, even if it belongs to a group?
If you physically modify your fleet of NICs, causing renumbering, you would need to revise your group assignments. But in that case you would only need to modify your hostname files. All other provisioning would be by group, and those files could remain unchanged.

Last edited by jggimi; 12th November 2014 at 10:59 AM. Reason: clarity, structure, and two typos
Reply With Quote
Old 12th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default More on switches...

My home network has two firewalls and three switches, with a single ISP.

The ISP's gateway is connected to the outer switch:
Code:
{Internet} [DOCSIS 3.0 modem]- [outer switch]
Both firewalls are connected to the outer switch, to each other for heartbeat and synchronization, and to the inner switch; they are little Alix platforms with three NICs.
Code:
[outer switch] - {firewalls} - [inner switch]
There is a third switch providing services to a group of entertainment devices in the living room, with a single Ethernet cable connected to the inner switch.
Code:
[inner-switch] - {workstations and WiFi AP} - [living room switch] - {TV, media players}
The firewalls provide a high availability solution. carp(4) is used on the inner network, the outer network connection is master/slave managed by ifstated(8), and the two firewalls synchronize DHCP server and PF states with dhcpd(8) -Y/-y options and pfsync(4).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BIND 10 is coming J65nko News 3 4th March 2010 08:58 PM
Problems setting up Bind Zmyrgel OpenBSD General 5 18th February 2010 04:24 PM
Bind-9.5 Petrocelli08 FreeBSD Ports and Packages 6 29th January 2009 12:03 AM
Transmission web inteface start when system boot mfaridi FreeBSD Ports and Packages 2 27th September 2008 06:53 AM
BIND as secondary for Windows DNS? cwhitmore FreeBSD Installation and Upgrading 7 16th May 2008 01:13 PM


All times are GMT. The time now is 08:31 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick