Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables and openVPN

Reply
Thread Tools Display Modes

iptables and openVPN

 
 
Shawn Wilson
Guest
Posts: n/a

 
      03-22-2005, 02:41 PM
Hi, I've got an openVPN server up and running with a client connected
but what iptables commands do I have to run to forward IP traffic
between tun0 and eth0?

ifconfig produces this:

eth0 Link encap:Ethernet HWaddr 000:09:57:34:AE
inet addr:192.168.2.10 Bcast:192.168.2.255
Mask:255.255.255.0
inet6 addr: fe80::2d0:9ff:fe57:34ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43127003 errors:0 dropped:0 overruns:0 frame:0
TX packets:48964901 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3661645438 (3.4 GiB) TX bytes:3251375468 (3.0 GiB)
Interrupt:10 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6055 errors:0 dropped:0 overruns:0 frame:0
TX packets:6055 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4412334 (4.2 MiB) TX bytes:4412334 (4.2 MiB)

tun0 Link encap:UNSPEC HWaddr
ED-FE-3B-F3-68-00-F4-1F-00-00-00-00-00-00-00
-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:40 (40.0 b)

iptables -L produces this:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

I can ping 10.8.0.1 from the openVPN client with no problems but I
can't ping 192.168.2.10. What am I missing here????

Thanks in advance,

Shawn
 
Reply With Quote
 
 
 
 
Matthias Degenkolb
Guest
Posts: n/a

 
      03-22-2005, 09:09 PM
Am Tue, 22 Mar 2005 07:41:01 -0800 schrieb Shawn Wilson:

> Hi, I've got an openVPN server up and running with a client connected
> but what iptables commands do I have to run to forward IP traffic
> between tun0 and eth0?


If you simply want to link/merge both interfaces, take a look at the
Bridging howto at openvpn.sf.net . This won't be a solution with iptables.

Possible solutions with iptables would be masquerading, SNAT or DNAT
(Native Address Translation), but this would alter the packet's addresses
and possibly isn't what you want.

> Thanks in advance,
>
> Shawn


 
Reply With Quote
 
Shawn Wilson
Guest
Posts: n/a

 
      03-23-2005, 12:44 PM
What if this tun0 was just another ethernet card, say eth1, how do you
make linux route between eth0 and eth1 (absolutely no filtering,
masquerading, NAT, etc. whatsoever - straight plain jane routing)?

Matthias Degenkolb <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> Am Tue, 22 Mar 2005 07:41:01 -0800 schrieb Shawn Wilson:
>
> > Hi, I've got an openVPN server up and running with a client connected
> > but what iptables commands do I have to run to forward IP traffic
> > between tun0 and eth0?

>
> If you simply want to link/merge both interfaces, take a look at the
> Bridging howto at openvpn.sf.net . This won't be a solution with iptables.
>
> Possible solutions with iptables would be masquerading, SNAT or DNAT
> (Native Address Translation), but this would alter the packet's addresses
> and possibly isn't what you want.
>
> > Thanks in advance,
> >
> > Shawn

 
Reply With Quote
 
Philippe WEILL
Guest
Posts: n/a

 
      03-23-2005, 01:09 PM


Shawn Wilson wrote:
> What if this tun0 was just another ethernet card, say eth1, how do you
> make linux route between eth0 and eth1 (absolutely no filtering,
> masquerading, NAT, etc. whatsoever - straight plain jane routing)?
>


just activate forwarding

echo 1 > /proc/sys/net/ipv4/ip_forward

and on your client define gw as your linux but if you have other
router in your network , they must know about network routed by your linux
--
Weill Philippe - Administrateur Systeme et Reseaux
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables + openvpn + masquerading Diaphragm Linux Networking 1 06-04-2008 09:16 AM
openvpn resets CptDondo Linux Networking 0 11-09-2007 04:14 AM
openvpn v. freeswan /dev/null Linux Networking 2 12-07-2004 01:23 AM
OpenVPN - Implementation ?'s tonydm Linux Networking 1 11-22-2004 03:13 PM
OpenVPN keys James Knott Linux Networking 2 09-02-2004 01:22 PM



1 2 3 4 5 6 7 8 9 10 11