# [SOLVED] Vpnc problems and dhcpcd questions!

## Nazgulled

Hi,

I'm trying to use vpnc to connect to my university wifi network but having some problems. I probably have read most of the vpnc topics on the forums but couldn't find an answer for my problem.

I started by following this guide: http://gentoo-wiki.com/HARDWARE_ipw2200 to install the drivers for my wireless card and wireless-tools. Just so you know, I have loaded all the encryptation modules on that guide. After that I emerged vpnc (currently using the stable version) and then edited the vpnc.conf file with my university wireless settings. I have also added the following lines to the /etc/conf.d/net file:

```
config_eth1=( "dhcp" )

dhcp_eth1="nodns nontp nonis"
```

Now, everytime I want to connect to the wifi network I perform the following commands:

```
iwconfig eth1 essid e-UM

dhcpcd eth1

vpnc-connect
```

I am asked for my password, and after that I recieve the following message:

 *Quote:*   

> RTNETLINK answers: File exists
> 
> VPNC started in background (pid: 5799)

 

I then try to ping a server like www.google.com and it doesn't work... It also takes a while befor saying host unreachable or something, can't really remember the correct error message.

To access the uni wifi network we need to use proxys or it won't work. I tried to add the http_proxy variable to /etc/env.d/99local, but the same thing happens...

Any help would be very appreciated.Last edited by Nazgulled on Mon Mar 06, 2006 1:17 am; edited 2 times in total

----------

## ecosta

No expert and never tried this but have you checked...

1. that your routing table is correct?

2. That you have a proper DNS.  Maybe ping a well known ip addres rather than a domain name.

Just my 2c.

 -Ed.

----------

## Nazgulled

1) could you be more specific? don't really know what you are talking about or how to check it...

2) I'll try it out in the next week when I get back to the uni, meanwhile, can you give me one IP example to test?

----------

## ecosta

Sorry mate,

didn't mean to sound cryptic... just never know how much one knows.

When you connect to a network via VPN you 'change' network and your route changes too.

Say if your home network is 192.168.1.0/24 with a default gateway of 192.168.1.1 and your uni network is 10.0.0.0/8 with a default gateway of 10.0.0.1.  This would mean that when you connect to the uni you will recieve an ip in the range 10.0.0.0/8.  The important part now is that your default gateway for all traffic to 10.0.0.0/8 be 10.0.0.1 and not 192.168.1.1 or your packets will get miss routed.

in short, you would need a command in the lines of "route add -net 10.0.0.1" or something along those lines.

Use "netstat -rn" to check your route table.

You can always ping my providers DNS for a start 212.100.160.51.

Pne last thing... your VPN connection will probably use a new connection "ppp0" (ifconfig) so look for all ref to ppp0 is "netstat -rn" and try and understand how traffic is routed.

Hope this helped.

 -Ed

----------

## Nazgulled

Ok... I checked my route table and I noticed something wrong because of my home wired network, which I had /etc/init.d/net.eth0 to start at boot, I then removed that service from startup, rebooted and it is now working somehow...

I still couldn't ping, nor www.google.com nor the ip you gave me directly, here are the results:

```
nazgulled@nazbox ~ $ ping -c 3 www.google.com

PING www.l.google.com (66.249.87.104) 56(84) bytes of data.

--- www.l.google.com ping statistics ---

3 packets transmitted, 0 received, 100% packet loss, time 2034ms

nazgulled@nazbox ~ $ ping -c 3 212.100.160.51

PING 212.100.160.51 (212.100.160.51) 56(84) bytes of data.

From 172.16.2.4 icmp_seq=1 Packet filtered

From 172.16.2.4 icmp_seq=2 Packet filtered

From 172.16.2.4 icmp_seq=3 Packet filtered

--- 212.100.160.51 ping statistics ---

3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2103ms

```

However, I'm in my gentoo box posting from firefox...

For my uni wireless connection to work we need to use proxys, for firefox, I changed them. I also tried to use the network tools that came with gnome to ping google with and without setting proxy settings in the gnome preferences but I didn't get any results. Do I need to have the $http_proxy variable set too?

Now, a few differente questions.

1) Do I need to run dhcpcd eth1 everytime I want to connect to this vpn?

2) Is it possible to have net.eth0 to start at boot without messing around with eth1 (the wireless connection)? When i'm at home, I have wired connection to my router an no wireless, when i'm at the uni, I have only wireless and not wired.

3) What exactly are for the gnome proxy settings? I tried to use them without setting them in firefox but wouldn't work... which kind of apps use them?

4) Executing "dhcpcd eth1" the nameservers on /etc/resolv.conf will be changed, is it possible to set different nameservers for eth1 (wireless) and eth0 (wired)?

----------

## Nazgulled

can anyone enlighten me a little more...

----------

## ecosta

I was on holiday so wasn't able to answer... although not sure I can help much more...

1) Your vpn connection should start a connection automatically (usually a ppp0) through the ethernet card of your choice.  If you run ifconfig it should show.  If it doesn't look at your logs for errors in connection.

2) you shouldn't have any conflicts between network cards as long as your routing tables are correct.

3) I think that gnome proxy is only used for the gnome environement... they have for example a file manager that can also act as a browser... etc.

4) No need to set different DNS for each NIC.  If eth0 and eth1 need different DNS servers, just specify them both in resolv.conf

You should have a good look at your logs and dmesg and see what is wrong.  netstat -rn is also very important

 -Ed

----------

## Nazgulled

thanks for all the answer, I've been through many things to make it work and it seems to be working... thanks.

----------

