LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2013, 03:38 AM   #1
_Rado_
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
Linux as Proxy Server for Wi-Fi (intermediary gateway)


Hi Guys

I need your help with configuration of linux station - 10.10.1.2
I would like to set it up as gateway (traffic analyzer/load balancer) for my wifi subnet.
I get connection to Internet from Linux station but I still don't get connection to it from wifi side when I use linux station as gateway for wifi clients.
For now I enebled packet forwarding on linux machine and I set up default gateway at 10.10.1.1 but as I see it's not enough.

I read some materials about iptables configuration and I know I probably need to use -nat table with POSTROUTING chain.
These materials say I should use SNAT instead of MASQUERADE because I have static ip.
Anyway I tried both of them and I couldn't access Internet from wifi side.
When I change configuration of wifi router and I set 10.10.1.1 as default gateway instead of 10.10.1.2 everything works fine but it's not my point;-).
Please help me with this configiration ang explain what I missed.

PS. I saw few examples on forum but they explained situation using two nic's with traffic forwarding between two different networks. In my situation I would like to use one nic and forward traffic inside one network. Is it even possible?


INTERNET GATEWAY
|10.10.1.1|
|
| SUBNET 10.10.1.0/24
|
|
|10.10.1.2| ----------SWITCH-----------|10.10.1.8|
LINUX PROXY WIFI ROUTER GW-10.10.1.2
GW-10.10.1.1 |
|192.168.0.0/24|
WIFI SUBNET
Attached Thumbnails
Click image for larger version

Name:	proxy.jpeg
Views:	40
Size:	38.2 KB
ID:	13181  

Last edited by _Rado_; 08-12-2013 at 04:04 AM. Reason: adding better network schema
 
Old 08-12-2013, 03:40 AM   #2
_Rado_
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
I apologise - network schema doesn't look fine. I will try fix it up.

Ok, I added picture with network schema - now it should be readable;-)

Last edited by _Rado_; 08-12-2013 at 04:06 AM. Reason: better network schema - jpg image
 
Old 08-12-2013, 08:34 AM   #3
_Rado_
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ok I tested some configurations and I achieve some positive results(for now).
My configuration was done using Fedora 19.
I used commands described below:

1. iptables-save > iptablesOriginalRules.conf (write predefined installation rules to file)
2. systemctl restart iptables.service (system erased all iptables rules, don't know why, in my opinion it should reload iptables with it's saved rules)

For myself the above are just fine. I could write basic configuration rules.

3. iptables -P INPUT DROP
4. iptables -P FORWARD DROP
5. iptables -P OUTPUT DROP

Three above are to block all trafic [no communication in/out Linux box, very secure box;-)]

6. iptables -A INPUT -i lo -j ACCEPT
7. iptables -A OUTPUT -o lo -j ACCEPT

Two above are to set up loopback interface

8. iptables -A FORWARD -j ACCEPT [allow packets forwarding via Linux box, probably not so secure at this stage]

9. iptables ... [build your own iptables security rules;-)]

For now it's ok. I have 'routing' via my Fedora linux box and I can make new steps;-).

Thank you for viewing my thread. If somebody has better solution I appreciate it. Have a nice day!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a web proxy/gateway/intermediary sburnay Linux - Software 2 06-28-2012 04:08 AM
Using Linux as an Internet Gateway/Proxy Server apmarsenault Linux - Server 1 12-30-2008 11:53 AM
Squid Gateway / Proxy Server TheRealDeal Linux - Networking 4 12-09-2004 06:20 AM
Project questions -> old pc as a gateway/proxy server for home thegeekster Linux - Networking 13 07-28-2004 08:51 AM
proxy server thru nat gateway. tanmay_79 Linux - General 1 09-10-2001 07:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration