exam questions

Exam EX200 All Questions

View all questions & answers for the EX200 exam

Exam EX200 topic 1 question 57 discussion

Actual exam question from RedHat's EX200
Question #: 57
Topic #: 1
[All EX200 Questions]

SIMULATION -
Your System is going to use as a Router for two networks. One Network is 192.168.0.0/24 and Another Network is 192.168.1.0/24. Both network's IP address has assigned. How will you forward the packets from one network to another network?

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
echo "1" >/proc/sys/net/ipv4/ip_forward
vi /etc/sysctl.conf
net.ipv4.ip_forward = 1
If you want to use the Linux System as a Router to make communication between different networks, you need enable the IP forwarding. To enable on running session just set value 1 to
/proc/sys/net/ipv4/ip_forward. As well as automatically turn on the IP forwarding features on next boot set on /etc/sysctl.conf file.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Lazylinux
3 months, 2 weeks ago
NEVER Directly edit sysctl.conf is not recommended, create customised file in the /etc/sysctl.d directory. echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.d/IP_Forwarding.conf sysctl --load /etc/sysctl.d/IP_Forwarding.conf ***DO NOT make mistake like others do and use -p because the option -p ONLY works if you edited the /etc/sysctl.conf file which is NOT recommended, so if you use customized file as per above **Highly recommended** then you must use option --load as per above example confirm by either sysctl -a | grep ip_forward or cat /proc/sys/net/ipv4/ip_forward NOTE:REBOOT is highly recommended but not necessary if you use the above procedure
upvoted 1 times
...
syed2020
2 years, 3 months ago
If you want your change to survive the reboot, insert below line vi /etc/sysctl.conf net.ipv4.ip_forward=1 reboot the machine and check cat /proc/sys/net/ipv4/ip_foward
upvoted 2 times
wizojlo
9 months ago
Directly editing sysctl.conf is not recommended anymore, configs now go to /etc/sysctl.d directory. echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.d/ipforward.conf sysctl -p reboot sysctl net.ipv4.ip_forward (to verify; should return a value of 1)
upvoted 1 times
Lazylinux
3 months, 2 weeks ago
Your answer is great, however DO NOT use -p if you making customized file because -p reads from the /etc/sysctl.conf file and NOT customized file to read from customized file use this sysctl --load /PATH_to_fileName - see my answer above
upvoted 1 times
...
...
...
badguy001djh
3 years, 4 months ago
Firewalld had been added a new option,--add-forward, in version 0.9.0 .With this option packects from one interface can be forwarded to another interface. https://firewalld.org/2020/04/intra-zone-forwarding
upvoted 2 times
badguy001djh
3 years, 4 months ago
By the way, two interfaces must be in the same zone.
upvoted 2 times
...
...
QuangTruong
3 years, 5 months ago
sysctl -w net.ipv4.ip_forward=1 sysctl net.ipv4.ip_forward
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...