I am using FreeBSD server 10.1. I have 3 Interfaces re0, re1, wlan0. I attached the Internet cable on re0 and configure dhcpd_iface as wlan0.
so that any devices that are connecting with my wifi can get the IP address. Now I want any devices that is trying to connect with re1 get the IP address of same subnet mask as of wifi.
You will want to bridge wlan0 and re1 and run dhcpd on the bridge interface. Something like this:
cloned_interfaces="bridge0"
ifconfig_bridge0="addm re1 addm wlan0 up"
ifconfig_bridge0_alias0="inet 192.168.0.1/24"
That'll create a bridge0 interface bridging wlan0 and re1 together. Now you can run your DHCP server on the bridge0 interface.
Related
I want to make my Raspberry PI model 3 as a router that is as follows -
Computer will be connected to RPI via Ethernet (eth0) interface
Phone will be connected to RPI over Wifi (wlan0) interface.
I was able to setup a interfaces with the help of the following links -
https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/
But I am not able to do the multicast routing from wlan0 to eth0 (or) vice versa Can you please help me with it. I need to route bonjour packets over the interfaces.
Note:
both the interfaces wlan and eth are supporting MULTICAST ( verified with ifconfig command ) I was able to get UP BROADCAST RUNNING MULTICAST for both the interfaces.
I have tried using the following commands for multicasting -
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
route add -net 224.0.0.0 netmask 240.0.0.0 dev wlan0
You can use avahi-daemon to reflect mDNS queries between interfaces. Some basic configuration like this in avahi-daemon.conf should be enough:
[server]
use-ipv4=yes
use-ipv6=yes
enable-dbus=no
allow-interfaces=eth0,wlan0
[publish]
disable-publishing=yes
[reflector]
enable-reflector=yes
This is quite an old discussion but I tried the given answer and it broke LAN DNS, so don't do it. Instead, edit file:
nano /etc/avahi/avahi-daemon.conf
change this one line to ‘yes’:
enable-reflector=yes
restart the service:
service avahi-daemon restart
check to see if the ports are detected automatically:
systemctl status avahi-daemon.service
Takes a minute for new services to be discovered and appear. Works on Buster. The app Discovery (formerly Bonjour Browser) is helpful to verify mDNS ZEROCONF multicast packets are getting across. Also there's an iOS app.
I am struggling with a network problem.
My computer needs to be linked to two differents networks. one via PCI the other one via a USB adapter. The pci is the "usual" network, the usb is to use for specific address.
I have tried differents solutions, with dns, multiple wired connection, modifiying /etc/network/interfaces, ...
But I can't manage to have the 2 networking working at the same time.
Do you have any solution. I am working with Debian - jessie.
Cheers
Since you haven't specified any networks, IP addresses or device names, I will use my machine as an example.
I have an IOGear ethernet USB dongle which shows up as device enx0050b6d341bb, and an RTL811 PCI ethernet device which shows up as eth0. eth0 is plugged into the "main" network which has a DHCP server and enx0050b6d341bb is connected to a private switch on my workbench.
If I want to use eth0 to connect to the internet, but use enx0050b6d341bb to connect to anything on network 192.168.168.0/24, /etc/network/interfaces will look like this:
auto lo
iface lo inet loopback
# Obtain DHCP address from server
auto eth0
iface eth0 inet dhcp
# Connect to 192.168.168.0 network
auto enx0050b6d341bb
iface enx0050b6d341bb inet static
address 192.168.168.3
network 192.168.168.0
netmask 255.255.255.0
Since I only have one device using DHCP, my default route will automatically go through that device, which happens to be exactly what I want :-)
solargy#GEPY633007AX:~$ ip route
default via 192.168.10.1 dev eth0
192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.10.67
192.168.168.0/24 dev enx0050b6d341bb proto kernel scope link src 192.168.168.3
The above shows that my default traffic will go through eth0 and that any traffic for addresses in network 192.168.168.0/24 will go through enx0050b6d341bb. To verify that, you can find out which device will be used to communicate with address 192.168.168.2:
solargy#GEPY633007AX:~$ ip route get 192.168.168.2
192.168.168.2 dev enx0050b6d341bb src 192.168.168.3
cache
As you can see, any traffic for 192.168.168.2 will go through enx0050b6d341bb.
I have two network interfaces (e.g. eth0 and eth1) configured as two ends of a bridge in Ubuntu Linux 14.04. They are not assigned with any IP addresses. eth0 is physically connected to a subnet. I want to send UDP packets through eth0 to a subnet connected machine. I create a UDP socket and check that it can successfully bind to eth0 (i.e. setsockopt(socket, SOL_SOCKET, SO_BINDTODEVICE, eth0, strlen(eth0)), and executing sendto() reports success as well. However, the designated target machine cannot receive anything from eth0!!
Is there any Ubuntu tools/commands to trace where the UDP packets go (actually, I did try to use Wireshark. But, Wireshark cannot detect any network interface to capture!)?
And, is there any workarounds, under the situation that eth0 and eth1 must be set as a interconnected bridge with no IP addresses, to make use of eth0 to send UDP packets to other machine with designated IP address and port?
i'm triying to imagine how to do:
(with Linux Debian based distro)
I have PC with 4 NIC:
eth0 = Internet Access (connect to router WAN)
eth1 = Local lan
eth2 = OUT NIC
eth3 = IN NIC
I need to send all traffic from eth1 (local lan) to eth2, receive the same traffic from eth3 and route to eth0.
The idea is send all eth1 traffic to external device over eth2, the external device inspect the packets and send to PC again on eth3, then my PC Linux route traffic to eth0
Is posible to do that ?
You're running linux on a PC? We need to know the version first off. Second you are looking into IProutes if you want to redirect traffic from one NIC to another.
I have two machines each with two valid network interfaces, an Ethernet interface eth0 and a tun/tap interface gr0. The goal is to start a TCP connection on machine A using interface gr0 but then have the responses (ACKs, etc) from machine B come back over the Ethernet interface, eth0. So, machine A sends out a SYN on gr0 and machine B receives the SYN on its own gr0 but then sends its SYN/ACK back through eth0. The tun/tap device is a GNU Radio wireless link and we just want the responses to come through the Ethernet.
What's the easiest way to accomplish this? I need to research more on TCP/IP, but I was initially thinking that source-spoofing outgoing packets would tell the receiver to respond to the spoofed address (which should get routed to eth0). This would involve routing the IPs from the tun/tap interfaces through gr0 and leave the other traffic to eth0.
We are using Linux and a Python solution would be preferable.
Thanks for looking!
You could add an additional address to the lo interface on each system and use these new addresses as the TCP connection endpoints. You can then use static routes to direct which path each machine takes to get to the other machine's lo address.
For example:
Machine A:
ip addr add 1.1.1.1/32 dev lo
ip route add 2.2.2.2/32 dev eth0 via <eth0 default gateway>
Machine B:
ip addr add 2.2.2.2/32 dev lo
ip route add 1.1.1.1/32 dev gr0
Then bind to 1.1.1.1 on machine A and connect to 2.2.2.2.
You may be interested in enabling logging of martian packets net.ipv4.conf.all.log_martians, and disable reverse path filtering net.ipv4.conf.<interface>.rp_filter on the affected interfaces.
This sysctl vars are accesible via the sysctl utility and/or the /proc filesystem.