EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 42


SIMULATION -

Please open the ip_forward, and take effect permanently.

Show Answer
Correct Answer:

To make IP forwarding effective permanently, you need to edit the sysctl configuration file and then reload the configuration. The following steps ensures that the change survives a reboot: 1. Open the sysctl configuration file with a text editor, for example, by using the command 'vi /etc/sysctl.conf'. 2. Add the line 'net.ipv4.ip_forward = 1' to the file. 3. Save and close the file. 4. Apply the changes immediately by running the command 'sysctl -p'. We do this to ensure the change is effective right away and will also be applied on reboot.

Discussion

7 comments
Sign in to comment
cytron
Nov 11, 2020

There is no option -P in RHEL8. You need to use the -w option followed by the argument sysctl -w net.ipv4.ip_forward=1 NOTE: No space before or after "=" sign.

kitkat
Jun 16, 2022

Would this survive reboot? Remember exam needs all changes that survives reboot.

Testo321
Nov 16, 2023

No, This will echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf sysctl -p

gaven186
Jul 4, 2024

you can view the system default line by "sysctl -a | grep ip_forward". "net.ipv4.ip_forward = 0" by system already has 'space' before/after '='. hence it is fine to have 'space'.

sugisho
Aug 14, 2021

[root@station ~]# sysctl -a | grep net.ipv4.ip_forward net.ipv4.ip_forward = 0 net.ipv4.ip_forward_update_priority = 1 net.ipv4.ip_forward_use_pmtu = 0 [root@station ~]# sysctl -w net.ipv4.ip_forward=1 net.ipv4.ip_forward = 1 [root@station ~]# sysctl -a | grep net.ipv4.ip_forward net.ipv4.ip_forward = 1 net.ipv4.ip_forward_update_priority = 1 net.ipv4.ip_forward_use_pmtu = 0 [root@station ~]#

gaven186
Jul 4, 2024

sysctl -w command cannot survive a reboot. hence others are suggesting to write a line into sysctl.conf. and followed by sysctl -p

kenkct
Mar 3, 2022

echo net.ipv4.ip_forward=1 >> /etc/sysctl.conf sysctl -p

ionix
Apr 2, 2021

# grep ip_forward /etc/sysctl.d/* /etc/sysctl.d/60-gce-network-security.conf:net.ipv4.ip_forward=0 # vi /etc/sysctl.d/60-gce-network-security.conf net.ipv4.ip_forward=0 # sysctl -w net.ipv4.ip_forward=1

AbidBajwa
Oct 7, 2021

vi /etc/sysctl.conf net.ipv4.ip_forward = 1

ANI_04
Oct 8, 2021

echo " net.ipv4.ip_forward = 1" >> /etc/sysctl.conf

tinythings
Apr 5, 2023

echo "net.ipv4.ip_forward = 1" > /etc/sysctl.d/ipforward.conf systemctl reboot