GOOGLE Search

Google
 

Wednesday, March 26, 2008

Linux Tip No. 36: How to Enable IP Forwarding

Enable IP Forwarding

1. Check if IP Forwarding is enabled

Using sysctl:

[root@proxy ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0

or just checking out the value in the /proc system:

[root@proxy ~]# cat /proc/sys/net/ipv4/ip_forward
0

Value 0 means it is disabled.

2. Enable IP Forwarding on the fly

[root@proxy ~]#sysctl -w net.ipv4.ip_forward=1

or

[root@proxy ~]#echo 1 > /proc/sys/net/ipv4/ip_forward

the setting is changed instantly; the result will not be preserved after rebooting the system.


3. Permanent setting using /etc/sysctl.conf

If we want to make this configuration permanent the best way to do it is using the file /etc/sysctl.conf where we can add a line containing net.ipv4.ip_forward = 1

[root@proxy ~]#vi /etc/sysctl.conf 
# Controls IP packet forwarding
net.ipv4.ip_forward = 1


if you already have an entry net.ipv4.ip_forward with the value 0 you can change that 1.

To enable the changes made in sysctl.conf you will need to run the command:

[root@proxy ~]#sysctl -p /etc/sysctl.conf

Restart the network service

[root@proxy ~]#service network restart

7 comments:

Anonymous said...

I inclination not approve on it. I think nice post. Expressly the appellation attracted me to be familiar with the unscathed story.

Anonymous said...

Nice brief and this mail helped me alot in my college assignement. Say thank you you for your information.

Anonymous said...

Good dispatch and this post helped me alot in my college assignement. Say thank you you as your information.

Anonymous said...

Opulently I agree but I contemplate the post should secure more info then it has.

Anonymous said...

Nice fill someone in on and this mail helped me alot in my college assignement. Say thank you you for your information.

Anonymous said...

Approvingly your article helped me altogether much in my college assignment. Hats afar to you send, wish look audacious in the direction of more related articles in a jiffy as its sole of my pet topic to read.

Anonymous said...

[url=http://abcwatches.co.uk/]fake watches[/url]

ok replica watches review
chanel 5th ave
coach outlet store online
rolex yachtmaster 2 replica
rolex yachtmaster ii swiss replica

http://watchesshop24.co.uk/