network manager / vpnc question
Phil Meyer
pmeyer at themeyerfarm.com
Mon Jan 19 23:51:46 UTC 2009
Mail Lists wrote:
> On 01/19/2009 04:23 PM, Craig White wrote:
>
>> On Mon, 2009-01-19 at 15:56 -0500, Mail Lists wrote:
>>
>>> On 01/19/2009 03:52 PM, Mail Lists wrote:
>>>
>>>> On 01/19/2009 03:42 PM, Mail Lists wrote:
>>>>
>>>> seems like some of the arguments can be up, down, vpn-up or vpn-down
>>>>
>>>> There must be some way to know which connection and which interface
>>>> is being up'ed or downed ... i cannot find the docs anywhere ... where
>>>> are the docs for this anyone know ?
>>>>
>>>>
>>> I still need help. Best I can tell
>>>
>>> $1 - is an interface (eth1, wlan0, etc)
>>> $2 - is one of "up", "down", "vpn-up", "vpn-down"
>>>
>>> I still have no idea which connection - the NM name - "work-ny-wired",
>>> "work-london-wifdi", or "home-wifi" or whatever the name used in NM. It
>>> does not seem to be passed to the scripts - so how can the scripts know
>>> what the right thing to do is ?
>>>
>> ----
>> standard shell conventions for 2 arguments being passed, $1 is the first
>> and $2 is the second and $0 is the command itself
>>
>
> Yes I know - question is what is passed to the scripts - things
> needed for script include
>
> interface - which is probabl the first arg
> action - which is probably the second
>
> which named connection is in play - which is not passed in as far
> as I can tell.
>
>
>> Honestly, I don't know what you're trying to accomplish by adding static
>> routes - generally they are unnecessary unless you need to hop to a
>> second vlan from vpn.
>>
>
> Example - split routing while using vpn. The vpn adds a default route
> via dev tun0 - which is fine if i am using the VPN in the office via
> wireless. If i am at home, I may want default route via my router and
> the additional routes are work only routes.
>
> Other things script may do is rotate local dns server, modify
> sendmail mailertable, change ntp, proxies etc etc ..
>
>
Sorry if this sounds trite. One cannot know the level of understanding
of a recipient on the list.
I wrote a script:
---
#!/bin/sh
echo $@ > /tmp/m.out
env >> /tmp/m.out
---
and put it in:
/etc/NetworkManager/dispatcher.d
The output looks like this:
eth0 up
IP4_NAMESERVERS=10.1.6.29 10.2.10.6
CONNECTION_UUID=5fb06bd0-0bb0-7ffb-0000-000000000000
DHCP4_NETWORK_NUMBER=10.7.22.0
IP4_NUM_ADDRESSES=1
DHCP4_DHCP_SERVER_IDENTIFIER=10.1.6.29
IP4_ADDRESS_0=10.7.22.205/23 10.7.22.1
IP4_DOMAINS=mydomain.com
DHCP4_DHCP_MESSAGE_TYPE=5
DHCP4_BROADCAST_ADDRESS=10.7.23.255
DHCP4_EXPIRY=1233618323
DHCP4_IP_ADDRESS=10.7.22.205
DHCP4_ROUTERS=10.7.22.1
PWD=/
IP4_NUM_ROUTES=0
DHCP4_HOST_NAME=myhost
SHLVL=1
DHCP4_DHCP_LEASE_TIME=1209600
DHCP4_DOMAIN_NAME=mydomain.com
DHCP4_SUBNET_MASK=255.255.254.0
DHCP4_DOMAIN_NAME_SERVERS=10.1.6.29 10.2.10.6
It seems to me, that if that is not enough info to make an educated
static routing decision, then I cannot imagine what you might need.
Good luck!
More information about the fedora-list
mailing list