Ask Your Question
0

Assigning a static IP address in Fedora 15

asked 2013-11-19 05:33:11 -0500

Nagaraju gravatar image

updated 2013-11-19 07:00:08 -0500

lzap gravatar image

Info in /etc/sysconfig/network-scripts/ifcfg-em1 before assigning static IP

DEVICE="em1"
ONBOOT=no
NM_CONTROLLED="yes"
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System em1"
UUID=1dad842d-1912-ef5a-a43a-bc238fb267e7
HWADDR=38:60:77:3F:5B:98
PEERDNS=yes
PEERROUTES=yes

After giving the static Ip address the above file is changed as following

DEVICE=em1
ONBOOT=yes
NM_CONTROLLED=yes
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System em1"
UUID=1dad842d-1912-ef5a-a43a-bc238fb267e7
HWADDR=38:60:77:3F:5B:98
PEERDNS=yes
PEERROUTES=yes
IPADDR=10.5.6.64
NETMASK=202.45.81.64
GATEWAY=10.5.6.1
DNS1=10.1.2.61
DNS2-10.1.2.62

Issue:After the network service is restarted I am unable to access the Internet but the website being hosted can be accessed over Internet.How to solve this issue? I had done the above changes by following the below mentioned link. here

edit retag flag offensive close merge delete

Comments

FYI: As @cobra says,that netmask is totally invalid.

Eddie gravatar imageEddie ( 2013-11-19 14:55:56 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2013-11-19 08:48:08 -0500

cobra gravatar image

updated 2013-11-19 08:57:56 -0500

If you're not using Network Manager, then with this configuration you can turn it off (do service NetworkManager stop followed by chkconfig NetworkManager off). You don't want NM waking up and spoiling your configuration.

The bit that seems to be out-of-the-ordinary is that value you've put in the NETMASK field.

This is used by the network layer to determine of stuff is intended for the local subnet or should be sent to the gateway. Your value is invalid, take a look at this subnet calculator site, and getting it wrong is likely to prevent you from sending packets to the network or gateway correctly (i.e. the behaviour you're seeing) while incoming data should reach you OK.

Where did you get the value from? Was it given to you by your ISP/Network Operator?

If your DNS servers are in your subnet then try using 255.0.0.0 for your netmask. If those DNS servers are provided by your network operator you may need to use 255.255.255.0 or 255.255.0.0 for your netmask. Restart your network after making changes.

edit flag offensive delete link more

Comments

@cobra Those numbers are provided by ISP.When I do off Network Manager still the same problem exists.

Nagaraju gravatar imageNagaraju ( 2013-11-21 22:10:36 -0500 )edit

If those numbers are supplied by your ISP, you should go back and double-check the netmask value they've given you. I'd guess that the value should be 255.255.255.0 - you might want to try that and see if it works (you can always swap it back if it doesn't).

cobra gravatar imagecobra ( 2013-11-22 03:58:20 -0500 )edit

I checked those numbers you have mentioned it doesnot work either

Nagaraju gravatar imageNagaraju ( 2013-11-22 05:47:52 -0500 )edit

@cobra Do I need to disable to firewall after changing to static Ip address?

Nagaraju gravatar imageNagaraju ( 2013-11-23 04:44:11 -0500 )edit
1

@cobra You were right the netmask value was the issue.I got a new value and it worked fine

Nagaraju gravatar imageNagaraju ( 2013-11-29 04:07:36 -0500 )edit
2

answered 2013-11-19 07:02:56 -0500

lzap gravatar image

updated 2013-11-19 07:10:22 -0500

If you want to configure your eth1 in this traditional way, you need to turn off NetworkManager control for this interface:

NM_CONTROLLED=no

That should do it. Also, check your DNS servers:

cat /etc/resolv.conf
ping YOUR_DNS1
host www.google.com

To make sure DNS works fine.

edit flag offensive delete link more

Comments

When I do this I don't get any Internet connection and my website cannot be accessed over Internet.

Nagaraju gravatar imageNagaraju ( 2013-11-19 23:17:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2013-11-19 05:33:11 -0500

Seen: 3,855 times

Last updated: Nov 19 '13