-   Linux - Newbie (
-   -   Files to change IP, mask, and default gateway, & on a vsftp server (

anon091 01-31-2014 08:54 AM

Files to change IP, mask, and default gateway, & on a vsftp server
I know in /etc/sysconfig/network-scripts/ for the ifcfg-eth0 you have to change the IP address, mask, and default gateway in that file for the actual interface itself.
Aren't there other files that may contain the mask and default gateway that I should check to see if they need to be updated as well?

Also, this is a vsftpd server, not sure if its config contains any network info that needs to be updated either?

myatthu 01-31-2014 09:51 AM

Yes you right if you only have one network card.
If you have more than one card, you need to find out which card is connected.
You can find out with ethtool command if you don't have physical access to server.
For vsftp server, generally it will listen on all the interfaces.
Find out which interfaces with
netstat -anp | grep vsftp

anon091 01-31-2014 10:30 AM

Thanks, i'll check it out. But isn't there another file somewhere (not one of the interface files but a general file) that might have at least the default gateway in it? I keep thinking there is for some reason.

myatthu 01-31-2014 10:41 AM

Although I am still confuse what you try to ask, for default gateway(route) at RedHat. You can configure two ways.
1. You can put GATEWAY=x.x.x.x at one of the /etc/sysconfig/network-scripts/if-cfgX
2. You can put GATEWAY=x.x.x.x at /etc/sysconfig/network

anon091 01-31-2014 11:00 AM

Ah, in /etc/sysconfig/network, that was the file I was referring to but couldn't remember what it was. Thanks myatthu.

anon091 01-31-2014 11:02 AM

when I look in my ifcfg-eth0, I don't have a gateway=x.x.x.x, so does that mean it's using the gateway that's in /etc/sysconfig/network? or could it be called something else in ifcfg-eth0, like network=x.x.x.x?

myatthu 01-31-2014 11:06 AM

If we are talking about default gateway or route, it should be GATEWAY. Not NETWORK
yes ifcfg is precedence then /etc/sysconfig/network. What do you see at that file?
What is your route output?


netstat -nr

anon091 01-31-2014 11:26 AM

I'm kinda confused, as those are both currently set to different IPs, so wasn't sure. Here's what's currently on my server, with the non-important numbers changed slightly. I've been given a new IP, mask, and default gateway so I can move my server, but I've never changed all that before so want to make sure I know all the spots I need to change.

more ifcfg-eth0

more network

netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface U 0 0 0 eth0 U 0 0 0 eth0 UG 0 0 0 eth0

myatthu 01-31-2014 11:40 AM

Based on your feedback, nothing is strange

Your IP is
So your network will be which you configure at ifcfg-eth0 as below [PASS]

Your route output as below
Code: U 0 0 0 eth0
You use first IP as gateway IP. It is valid (but that depend on your network either first or last IP. What is your router interface IP) as long as correct [PASS]
Your route output is correct too
Code: UG 0 0 0 eth0
Looks everything fine.

anon091 01-31-2014 01:07 PM

OK, so the NETWORK= really I just figure out by using the IP address and the netmask values, right?

myatthu 01-31-2014 06:00 PM

Yes. What you configure and routing table is result is correct

anon091 02-03-2014 02:32 PM

What I still don't understand exactly is, how do I figure out that with an IPADDR= and NETMASK=, that that equals a NETWORK= Like if someone gave me an IP and netmask, how do you go about figuring out network?

myatthu 02-03-2014 05:30 PM

You can simply study the CIDR subnet calculation for further understanding.
The other way is use ip subnet calculator.

anon091 02-04-2014 06:39 AM

I used an online calculator, thanks.

All times are GMT -5. The time now is 11:34 PM.