LinuxQuestions.org
Review your favorite Linux distribution.
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-28-2010, 04:45 PM   #1
commers
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Rep: Reputation: 0
Permission problem writing to /proc/sys/net/ipv4/conf/ethXX/proxy_arp


I am trying to enable proxy ARP on Ethernet devices on the fly from user mode scripts, e.g. echo 1 > /proc/sys/net/ipv4/conf/eth0.2/proxy_arp. It has to be dynamic ( I am making VLAN subinterfaces on the fly) and it has to run from user shell, even if I have to use sudo. The problem is if I try sudo echo 1 > ..... or even sudo -s echo > 1 it denies permission. The only way I can make it work is sudo -s<CR>, followed by echo >1...., then exit the root shell. Is there an easier way?
 
Old 08-28-2010, 04:54 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 488

Rep: Reputation: 78
try this:

Code:
sudo -s 'echo 1 > /proc/sys/net/ipv4/conf/eth0.2/proxy_arp'
The problem stems from the user losing sudo once the command has executed (echo) and then that user that ran sudo does not have permission to write to the file (proxy_arp). When you run the entire command in quote as exampled above the permissions are still escalated when the write to the file (proxy_arp) is attempted so it should succeed.
 
1 members found this post helpful.
Old 08-28-2010, 07:06 PM   #3
commers
LQ Newbie
 
Registered: Aug 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up Itr worked, thanks.

That was it...thanks a lot.
 
Old 08-28-2010, 07:08 PM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Good to know, thanks!
 
  


Reply

Tags
sudo



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
Can't create file using echo: /proc/sys/net/ipv4/ip_local_port_change rsumbeling Linux - General 4 07-17-2013 04:20 AM
nat not working, cannot change /proc/sys/net/ipv4/ip_forward 70k51k Linux - Networking 7 12-04-2006 10:16 AM
/proc/sys/net/ipv4/ip_local_port_range suse 10.1 not set at boot PredatorX Linux - Networking 4 11-29-2006 01:54 AM
/proc/sys/net/ipv4/ip_local_port_range wetwet Linux - Networking 0 07-06-2004 08:47 AM
default values for /proc/sys/net/ipv4 robeb Linux - Networking 0 06-07-2002 12:35 AM

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

All times are GMT -5. The time now is 01:53 PM.

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