HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Problem - Linux as VPN and Internet gateway
Operating System - Linux
1828481
Members
3182
Online
109978
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2011 08:26 PM
04-01-2011 08:26 PM
Problem - Linux as VPN and Internet gateway
Hi dear memebers.
I just set up a linux server which is acting as an internet gateway. For specific reason clients first make a vpn connection trough the internet to the linux server.
On the linux server iptables is configured for NAT.
The problem is that the internet speed becomes slower than expected.
I used windows and RAAS and the speed was realy good.
The server has only 1 NIC(eth0) and an alias interface is added to eth0. the alias is eth:0 with ip address 192.168.0.253
iptables config is as follows:
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F
iptables -A FORWARD -d 192.168.0.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to MY_VALID_IP
Please Help.
I just set up a linux server which is acting as an internet gateway. For specific reason clients first make a vpn connection trough the internet to the linux server.
On the linux server iptables is configured for NAT.
The problem is that the internet speed becomes slower than expected.
I used windows and RAAS and the speed was realy good.
The server has only 1 NIC(eth0) and an alias interface is added to eth0. the alias is eth:0 with ip address 192.168.0.253
iptables config is as follows:
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F
iptables -A FORWARD -d 192.168.0.0/24 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to MY_VALID_IP
Please Help.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2011 09:16 PM
04-03-2011 09:16 PM
Re: Problem - Linux as VPN and Internet gateway
Have you tested the speed of the VPN when the NAT is disabled, and vice versa?
> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to MY_VALID_IP
This looks slightly wrong: it applies SNAT to all outgoing traffic with 192.168.0.* source addresses. Even traffic that is going *to* the 192.168.0.* network will get SNATted, which probably isn't exactly what you wanted.
Try this line instead:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 \! -d 192.168.0.0/24 -j SNAT --to MY_VALID_IP
SNAT should be applied to Internet traffic only, not to traffic that is going to your internal network. This line should SNAT everything that has source address within 192.168.0.*, and destination address NOT within 192.168.0.*.
MK
> iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to MY_VALID_IP
This looks slightly wrong: it applies SNAT to all outgoing traffic with 192.168.0.* source addresses. Even traffic that is going *to* the 192.168.0.* network will get SNATted, which probably isn't exactly what you wanted.
Try this line instead:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 \! -d 192.168.0.0/24 -j SNAT --to MY_VALID_IP
SNAT should be applied to Internet traffic only, not to traffic that is going to your internal network. This line should SNAT everything that has source address within 192.168.0.*, and destination address NOT within 192.168.0.*.
MK
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2011 01:26 AM
04-04-2011 01:26 AM
Re: Problem - Linux as VPN and Internet gateway
Thank you dear Matti but the problem still persists. I just found that even when I run an apache server and simply download a file from my server, I will get a maximum of 10KB/s. The server has 100 Mb/s of internet connectivity and my internet sepeed is about 2 Mb/s. Please help me.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP