Comments (12)
With isc-dhcp-relay, the source interface is stored as suboption 1 of option 82 as follows:
- Byte 0: Suboption number, always set to 1
- Byte 1: Length of suboption data in bytes (i.e., length of interface name)
- Bytes 2~(2+<value in byte 1>-1): Suboption data (i.e., interface name)
Since the request comes from the Vlan on our T0s, the interface name stored is the name of the Vlan interface.
from sonic.
The actual format should be "%h:%p", where %h is the host name and %p is the port name.
ip dhcp relay information option
ip dhcp relay sub-option circuit-id format-type string format "%h:%p"
from sonic.
Unfortunately, it appears that the option 82 circuit-id string is not customizable with isc-dhcp-relay:
Options available in DHCPv4 mode only:
-a
Append an agent option field to each request before forwarding it to the server. Agent option fields in responses sent from servers to clients will be stripped before forwarding such responses back to the client. The agent option field will contain two agent options: the Circuit ID suboption and the Remote ID suboption. Currently, the Circuit ID will be the printable name of the interface on which the client request was received. The client supports inclusion of a Remote ID suboption as well, but this is not used by default.
https://linux.die.net/man/8/dhcrelay
We may need to consider a different solution, or patching isc-dhcp-relay to suit our needs.
from sonic.
https://lists.isc.org/pipermail/dhcp-users/2015-January/018523.html
from sonic.
Thanks for this link. It looks like this is a patch applied to the same version of isc-dhcp-relay that Debian currently provides (i.e., what we're currently using), so this is good. However, it does not support appending the hostname. So, we have a few options:
1.) Append the hostname in the command line when starting the relay
- Simplest; requires Jinja2 templating the command in the Dockerfile
2.) Add a hostname option and create a PR @ https://github.com/jpereira/isc-dhp-relay
- This repo hasn't been updated for 2 years; might not ever get merged
3.) Fork the https://github.com/jpereira/isc-dhp-relay repo and make the modification in our fork
- This gives us the most control over future updates (e.g., we can rebase against newer versions if we want to upgrade), but it's also another repo to manage (probably not very often, though)
What are your thoughts?
from sonic.
I haven't looked at the patch in detail, how can we get the source incoming interface in our vlan case?
from sonic.
I see that the relay supports listening on multiple interfaces. So, instead of telling the relay to listen on the VLAN interface, we can start the relay so that it listens on all the member interfaces individually. I believe this will cause the source interface name to be appended to Option 82 as we desire.
from sonic.
can you check? I am not so sure as the other interfaces do not have IP address.
from sonic.
Looks like your doubts were correct; the packet is discarded because the interface doesn't have an IP.
dhcrelay: Discarding packet received on Ethernet4 interface that has no IPv4 address assigned.
We'll have to figure out a way to determine the source interface, and most likely patch the relay.
from sonic.
ok. Looks like we can only listen to the vlan interface. However, we need to figure our the real source interface. one idea is that when you receive the package, use brctl showmacs [vlan_intf_name], find out the which source interface has the source mac of the packet.
from sonic.
try use ip_pktinfo->ifindex to deduce the source interface? will it work?
from sonic.
I recompiled isc-dhcp-relay and forced it to use sockets, and unfortunately, in_pktinfo->ipi_ifindex contains the index of the VLAN interface, not the actual source interface.
from sonic.
Related Issues (20)
- ECMP hash offset configuration HOT 1
- Orchagent Error Handling enablement
- Warm reboot enhancement to handle disk read only gracefully HOT 2
- NetScan over VLAN support HOT 4
- Container image upgrade to BookWorm HOT 1
- SSD health monitor HOT 1
- gNOI API to enhance operational excellence
- BGP monitoring improvement through ST w/ OpenBMP
- SWSS Upstream of P4Orch changes HOT 1
- Upstreaming Ondatra Framework + MVP tests HOT 2
- gNMI Save On Set HOT 1
- Nonexistent SONIC builds
- Unable to install/use software switch HOT 1
- SONiC Debian Upgrade Cadence - process improvement
- Able to boot on an Arista 7050T, but it throws a `fallocate: fallocate failed: Operation not supported` error HOT 1
- Celestica Seastone DX010 - SFP port not working
- Celestica DX010, when setting all the Ethernet ports MTU to 9216 it crashes swss and other dockers
- SONiC Management Framework gNMI Client Example Client Operations
- EVPN VxLAN Multihoming HOT 2
- Arista 7050QX-32S's Image download link in supported_devices_platforms.md is correct?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonic.