re-searcher
asked on
how to edit files Linux (Ubuntu Distr.)
Hello,
In my Linux Server some file not editable or when i edit them after reboot it's back to it previous version.
for example for /etc/ufw/ufw.conf I edit "enable=no" to "enable=yes" and saved it, but after reboot when I print ufw.conf's contents it's back to previous version.
I found a way for this, i change file permission to 755 and edit with root permission and it's not back to previous version.
after it new problem occur for me. I want to edit "/proc/sys/net/ipv4/ip_for ward" but it's back to previous version after each reboot. i trying to set permission and receive following error:
using chattr but it's not work and i received following error:
Whould you mind help me?!
In my Linux Server some file not editable or when i edit them after reboot it's back to it previous version.
for example for /etc/ufw/ufw.conf I edit "enable=no" to "enable=yes" and saved it, but after reboot when I print ufw.conf's contents it's back to previous version.
I found a way for this, i change file permission to 755 and edit with root permission and it's not back to previous version.
after it new problem occur for me. I want to edit "/proc/sys/net/ipv4/ip_for
root@testserver:/proc/sys/net/ipv4# chmod 755 ip_forward
chmod: changing permissions of `ip_forward': Operation not permitted
using chattr but it's not work and i received following error:
root@testserver:/proc/sys/net/ipv4# chattr +a ip_forward
chattr: Inappropriate ioctl for device while reading flags on ip_forward
Whould you mind help me?!
I'm glad Ubuntu prevents you from doing those things :)
Edit /etc/sysctl.conf, and add the following
If you want to enable forwarding, change the value to 1.
Edit /etc/sysctl.conf, and add the following
net.ipv4.ip_forward = 0
thensudo sysctl -p
If you want to enable forwarding, change the value to 1.
Doing so will make the change persistent across reboots.
To clarify on my answer,
Edit sysctl.conf to make sysctl changes persistent.
'sysctl -p' reads in /etc/sysctl.conf and makes your edit live on the system before a reboot.
If there is already a value present for the token you want to change, edit that instead of creating a new entry.
Edit sysctl.conf to make sysctl changes persistent.
'sysctl -p' reads in /etc/sysctl.conf and makes your edit live on the system before a reboot.
If there is already a value present for the token you want to change, edit that instead of creating a new entry.
ASKER
# kerimit
I run those commands with root privillage, first i run "sudo bash" and then run command you can see root username before @
# Papertrip
Thank, but i don't want to set ip_forwarding from /etc/sysctl.conf
I know this way, I just wanna know how it's possible we edit "/proc/sys/net/ipv4/ip_for ward" in one of war games i saw it.
and my next question is I run "ufw enable" command and enable UFW for run at boot, but after reboot i checked "ufw status" and received "inactive" why?
I run those commands with root privillage, first i run "sudo bash" and then run command you can see root username before @
# Papertrip
Thank, but i don't want to set ip_forwarding from /etc/sysctl.conf
I know this way, I just wanna know how it's possible we edit "/proc/sys/net/ipv4/ip_for
and my next question is I run "ufw enable" command and enable UFW for run at boot, but after reboot i checked "ufw status" and received "inactive" why?
I know this way, I just wanna know how it's possible we edit "/proc/sys/net/ipv4/ip_forward" in one of war games i saw it.
[root@broken tmp]# cat /proc/sys/net/ipv4/ip_forward
0
[root@broken tmp]# echo "1" > /proc/sys/net/ipv4/ip_forward
[root@broken tmp]# cat /proc/sys/net/ipv4/ip_forward
1
ASKER
# Papertrip
I do it before, but as I said in my question, after reboot ip_forward's content back to previous version (from 1 to 0)
I do it before, but as I said in my question, after reboot ip_forward's content back to previous version (from 1 to 0)
I do it before, but as I said in my question, after reboot ip_forward's content back to previous version (from 1 to 0)As I said in my previous answers, edit sysctl.conf to make it persistent across reboots.
and my next question is I run "ufw enable" command and enable UFW for run at boot, but after reboot i checked "ufw status" and received "inactive" why?Is iptables running?
ASKER
# Papertrip
I read in Ubuntu which ufw is back-end of iptables and will make iptables management easier.
currently my problem is I create PPTP Server and everythings ok, i could connect to server and i can ping myself (192.168.1.2) from server and server( 192.168.1.1) from client.
but i can browser internet after connection established.
Is iptables running?
I read in Ubuntu which ufw is back-end of iptables and will make iptables management easier.
currently my problem is I create PPTP Server and everythings ok, i could connect to server and i can ping myself (192.168.1.2) from server and server( 192.168.1.1) from client.
but i can browser internet after connection established.
I don't think ufw is supposed to be "started" at boot... it's not a service, it's just a frontend tool to configure iptables. When you need to use ufw, just enable it first and go about your business.
currently my problem is I create PPTP Server and everythings ok, i could connect to server and i can ping myself (192.168.1.2) from server and server( 192.168.1.1) from client.
but i can browser internet after connection established.
Ok well that is quite a different issue than your original question :)
ASKER
My Server is Ubuntu which I install eBox Zentyal on That.
I do as you said on post #37074819
but after i reboot server sysctl -p return ipforwarding = 1 and /proc/sys/net/ipv4/ip_forw arding is zero 0
I do as you said on post #37074819
but after i reboot server sysctl -p return ipforwarding = 1 and /proc/sys/net/ipv4/ip_forw
ASKER
Ok well that is quite a different issue than your original question :)
I will Open new post after my ipv4_forwarding proble solved.
Would you mind help me on pptp routing?
but after i reboot server sysctl -p return ipforwarding = 1 and /proc/sys/net/ipv4/ip_forwPaste the output of the following command:arding is zero 0
grep ip_forward /etc/sysctl.conf
I will Open new post after my ipv4_forwarding proble solved.Sounds good.
Would you mind help me on pptp routing?I'm I'm still awake :p
I'm I'm still awake :p
Err that should be "If I'm still awake" ... can you tell I'm already half asleep?
ASKER
Paste the output of the following command:
root@testserver:~# grep ip_forward /etc/sysctl.conf
net.ipv4.ip_forward=1
Something isn't right here...
Paste the following as well please to make sure we are on the same page.
Paste the following as well please to make sure we are on the same page.
cat /proc/sys/net/ipv4/ip_forward
sysctl net.ipv4.ip_forward
cat /etc/network/options
grep forward /etc/rc.local
ASKER
root@testserver:/etc# cd /proc/sys/net/ipv4/
root@testserver:/proc/sys/net/ipv4# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0
root@testserver:/proc/sys/net/ipv4# cat /etc/network/options
cat: /etc/network/options: No such file or directory
root@testserver:/proc/sys/net/ipv4# grep forward /etc/rc.local
root@testserver:/proc/sys/net/ipv4#
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
#Papertrip
Thanks, I do like this and reboot server and /proc/sys/net/ipv4/ip_forw arding is set to 1
for other values i should do like this?
would you mind explain what sysctl -w do?
Thanks, I do like this and reboot server and /proc/sys/net/ipv4/ip_forw
for other values i should do like this?
would you mind explain what sysctl -w do?
That is weird that it didn't work before.
-w takes a sysctl setting and changes the value to what you specify.
So the change works now across reboots? Are you all set?
-w takes a sysctl setting and changes the value to what you specify.
sysctl [-n] [-e] [-q] -w variable=value ...
-w Use this option when you want to change a sysctl setting.
So the change works now across reboots? Are you all set?
for other values i should do like this?
Whatever you did to make it work this time, do it for your future changes :)
ASKER
#/proc/sys/net/ipv4/ip_forward
0
sorry Papertrip it's return back to 0 again.
but i read some where else /proc/* will return back on each reboot
https://www.experts-exchange.com/questions/27429200/routing-traffic-through-linux-PPTP-server.html?anchorAnswerId=37075092#a37075092
I Hope solved your problem