Create a "bridge" between eth1 and tun0 - linux

I'm trying to access remotely a device (in this case a PLC) through a 3G/4G internet connection.
I have a Raspberry PI connect to the internet with a 3G modem and a OpenVPN configured on it.
The eth0 port is connected to the 3G/4G modem and the eth1 port is connected to the PLC.
How do I add the eth1 port to the VPN connection so I can access the PLC trough any computer connected to this VPN?
This images may better explain what I'm tryng to achive:
physical connections
virtual connections

Related

SMA390 RPC port not responding for public facing IP

I have been working on CISCO's SMA390 and the RPC port for the device is not responsive when connected to a core switch.
1. The core switch is for public-facing IP/ CIMC IP of the device.
2. The IP's are configured and using ipmitool command.
3. The port is responding when tried to configure over a private network(laptop to device connection).
I have tried ping command after checking that the IP's are configured and its failing while the gateway is responding.
ipmitool lan print 1
ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.10.1.5
ipmitool lan set 1 netmask 255.255.255.0
ipmitool lan set 1 defgw ipaddr 10.10.1.1
ipmitool lan set 1 access on
ipmitool raw 0x36 0x52 0x0f
I want the ping and the ssh to be enabled.
I figured out after some more troubleshooting that CISCO x90 devices by default work on 100G bandwidth connection. The default provided on x95 devices is 1000G bandwidth connection. Hence the RPC port didn't respond.
If you face this issue, try
1. using a 100G connection.
2. change the default connection acceptance bandwidth of your device(i.e x90 here).

How to configure dd-wrt router, for internet connection from other router in other subnet?

I can not solve this problem.
There modem / router (192.168.1.1) with wifi which distributes online. There wifi and router with dd-wrt, which must also distribute the Internet, but in the subnet 192.168.2.1.
How to configure a router with dd-wrt, that it was possible to connect by cable to the lan port of the first router (192.168.1.1) and when connected to the router on which the dd-wrt on lan or wifi, the device receives from the network ip 192.168.2.X and have access to the internet?
All you should have to do is change the router's LAN address to 192.168.2.1 and adjust the DHCP range and similar parameters to match. All other parameters (other than configuring things you specifically need) can stay at their defaults. Then connect the new router's WAN port to one of the modem/router's LAN ports.

Send UDP packets through no IP assigned bridge interface in Ubuntu Linux

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?

ICMP packets leave linux device with wrong IP source after VPN establishment

I’m using Linux 2.6.32 device that establishes a VPN connection. When VPN is up, all packets sent by the device, includes the VPN client src address.
ICMP packets continuously go through the VPN interface and successfully encrypted/decrypted, and after that they are sent to the WLAN via the WLAN interface (as ESP packet with the VPN Interface as src ip).
After disabling the VPN, the VPN interface goes down, ICMP packets are sent directly to the WLAN interface (with the WLAN Interface as src ip) in plaintext un-encrypted.
But when the VPN is established again and the VPN interface is up again, packets are sent at the same way, but the ESP packet encapsulates a WLAN src IP and not the VPN src IP.
ICMP packets go through the VPN interface and then via WLAN interface as ESP packet with the WLAN Interface as src ip and not VPN Interface as src ip.
The only way to have the ESP packets leave with the VPN IP address encapsulated is either:
Wait until the machines "nf_conntrack_icmp_timeout" expires, and restart ping application.
Remove the WLAN interface (ifconfig down) and set it up again (ifconfig up).
Both solutions are not appropriate, as I don’t want to stop the ping and I don’t want to reconfigure the device network interface.
I tried to clear the routing cache by:
echo 1 > /proc/sys/net/ipv4/route/flush
And I also tried to clear the ARP cache by:
ip -s -s neigh flush all
Is there another way to clear all active session, after the VPN is going down?

Send all traffic to network interface and receive from other

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.

Resources