Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to redirect packets received from one network interface to another network interface?

I am using ubuntu11.10, and I created a tun/tap interface using the following commands

openvpn --mktun --dev tun0
ip link set tun0 up
ip addr add 10.10.10.1/24 dev tun0
route add 10.10.10.1/24 dev tun0

I have another interface there

eth0 10.80.1.87

I wanna redirect packets received from tun0 to eth0. How to do that on top of Ubuntu?

like image 842
user1072898 Avatar asked Oct 19 '25 14:10

user1072898


1 Answers

As a complement to the two otherwise good answers, remember that:

  • bridging work at link layer ("ethernet level") -- and so configuring a bridge between two interfaces is mostly like wiring them through a (virtual) switch
  • forwarding work at network layer ("IP level") -- and so configuring forwarding between two interfaces is like connecting them through a (virtual) router
like image 133
Sylvain Leroux Avatar answered Oct 22 '25 04:10

Sylvain Leroux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!