Networking Forums

Networking Forums > Computer Networking > Linux Networking > IPSEC link in Ad-Hoc WIFI link very slow

Reply
Thread Tools Display Modes

IPSEC link in Ad-Hoc WIFI link very slow

 
 
Fabrice Delente
Guest
Posts: n/a

 
      11-07-2008, 07:23 AM
Hello.

I have two laptops; one of them is connected to the internet, and acts as a
router for the other.

I'm using kernel 2.6.24 on both machines.

As both laptop only have one ethernet port, and are WIFI-able, I hook up the
router to the internet through its ethernet port, and the laptops
communicate through WIFI.

As I wanted to secure their exchanges, I set up an IPSEC link between them.
I gave the router 192.168.1.3 for its IP, and 192.168.1.4 to the client.

To route the packets, I set up 192.168.1.3 (the router) this way:

/usr/local/sbin/dnsmasq
echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe ipt_MASQUERADE
/usr/sbin/iptables -F
/usr/sbin/iptables -t nat -F
/usr/sbin/iptables -t mangle -F
/usr/sbin/iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <IP_of_the_internet_modem>
echo 1 > /proc/sys/net/ipv4/ip_forward
/usr/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/usr/sbin/iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
/usr/sbin/iptables -P INPUT DROP
/usr/sbin/iptables -A FORWARD -i eth0 -o eth0 -j REJECT

To make sure that the only valid address on 192.68.1.* was that of the
client, I added these rules to the firewall:

/usr/sbin/iptables -A INPUT -s 192.168.1.4 -j ACCEPT
/usr/sbin/iptables -A INPUT -s 192.168.1.0/255.255.255.0 -j REJECT
/usr/sbin/iptables -A OUTPUT -s 192.168.1.3 -j ACCEPT
/usr/sbin/iptables -A OUTPUT -s 192.168.1.0/255.255.255.0 -j REJECT

However my WIFI link between the two laptops is very slow: when I ssh from
the client to the router I have about 1 character-per-second typing and echo
rate.

Is my config flawed? How can I speed it up?

Thanks!

--
Fabrice DELENTE
 
Reply With Quote
 
 
 
 
Cacadril
Guest
Posts: n/a

 
      11-09-2008, 06:38 PM
On Nov 7, 9:23*am, Fabrice Delente <fdele...@mail.cpod.fr> wrote:
> Hello.
>
> I have two laptops; one of them is connected to the internet, and acts asa
> router for the other.
>
> I'm using kernel 2.6.24 on both machines.
>
> As both laptop only have one ethernet port, and are WIFI-able, I hook up the
> router to the internet through its ethernet port, and the laptops
> communicate through WIFI.
>
> As I wanted to secure their exchanges, I set up an IPSEC link between them.
> I gave the router 192.168.1.3 for its IP, and 192.168.1.4 to the client.
>
> To route the packets, I set up 192.168.1.3 (the router) this way:
>
> /usr/local/sbin/dnsmasq
> echo 1 > /proc/sys/net/ipv4/ip_forward
> modprobe ipt_MASQUERADE
> /usr/sbin/iptables -F
> /usr/sbin/iptables -t nat -F
> /usr/sbin/iptables -t mangle -F
> /usr/sbin/iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <IP_of_the_internet_modem>
> echo 1 > /proc/sys/net/ipv4/ip_forward
> /usr/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> /usr/sbin/iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
> /usr/sbin/iptables -P INPUT DROP
> /usr/sbin/iptables -A FORWARD -i eth0 -o eth0 -j REJECT
>
> To make sure that the only valid address on 192.68.1.* was that of the
> client, I added these rules to the firewall:
>
> /usr/sbin/iptables -A INPUT -s 192.168.1.4 -j ACCEPT
> /usr/sbin/iptables -A INPUT -s 192.168.1.0/255.255.255.0 -j REJECT
> /usr/sbin/iptables -A OUTPUT -s 192.168.1.3 -j ACCEPT
> /usr/sbin/iptables -A OUTPUT -s 192.168.1.0/255.255.255.0 -j REJECT
>
> However my WIFI link between the two laptops is very slow: when I ssh from
> the client to the router I have about 1 character-per-second typing and echo
> rate.
>
> Is my config flawed? How can I speed it up?


I would not suspect the iptables config to cause slowness. It will
either block 100% or let through speedily.

Just to make sure, you should try briefly with the firewall disabled.
If you are very worried about the security, use netstat -atp and
netstat -utp, and kill all programs that listen on any interface other
than the loopback interface (127.0.0.1).

Try to set up masquerading as per rustys unreliable guides, instead of
postrouting snat.

Try something not involving IPSEC, and see how fast that is.

You could try ping -i 0.2, and you could try ping -f. Man ping.

Regards
 
Reply With Quote
 
Fabrice Delente
Guest
Posts: n/a

 
      11-10-2008, 03:45 PM
Cacadril <(E-Mail Removed)> wrote:
<snip>

Ok, thanks! I will try that.

--
Fabrice DELENTE
 
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
IPsec wifi link in ad-hoc mode Fabrice Delente Linux Networking 7 09-27-2008 03:35 PM
IPv6 + IPsec + ipsec-tools 0.6.[4567] + scope:link = no SA established phil-news-nospam@ipal.net Linux Networking 0 07-25-2007 09:01 PM
d-link 300t - d-link 614+ - d-link 800ap+ Bill Middleton Home Networking 2 11-30-2004 10:35 PM
VERY SLOW LINK WITH THE SERVER PAQUITO Windows Networking 0 03-07-2004 10:43 PM
Slow link Clint Windows Networking 2 03-04-2004 08:01 PM



1 2 3 4 5 6 7 8 9 10 11