Используйте код, как показано ниже, это может вам помочь.
private void init() throws IOException {
DatagramChannel channel = DatagramChannel.open(StandardProtocolFamily.INET);
channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
channel.configureBlocking(true); //optional
channel.bind(new InetSocketAddress(5000));
InetAddress iGroup = InetAddress.getByName("224.0.0.1");
NetworkInterface intrf = NetworkInterface.getByName("lo"); // lo name could be changed according your requirement
channel.setOption(StandardSocketOptions.IP_MULTICAST_IF, intrf);
channel.join(iGroup, intrf);
}