LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack 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: 452

Rep: Reputation: 68
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
Guru
 
Registered: Apr 2005
Location: /proc/self/
Distribution: Custom version of Fedora 16, 64 bit, custom 3.2.7 kernel
Posts: 5,647
Blog Entries: 9

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


Reply

Tags
sudo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Can't create file using echo: /proc/sys/net/ipv4/ip_local_port_change rsumbeling Linux - General 3 12-10-2004 02:24 PM
/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


All times are GMT -5. The time now is 02:21 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration