PDA

View Full Version : server networksettings


d3m0nic
5th July 2006, 14:54
Hello,

I've installed my supermicro server with Fedora Core 5. I'm planning to place the server within a ISP's network. I've tested the OS at home and everything works fine, but this network differs from the network of my ISP.

ifconfig output:[root@host1 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:58:57:12:B2
inet addr:192.168.1.110 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::230:58ff:fe57:12b2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:46 errors:0 dropped:0 overruns:0 frame:0
TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6193 (6.0 KiB) TX bytes:7389 (7.2 KiB)
Interrupt:177

eth1 Link encap:Ethernet HWaddr 00:40:58:57:12:B3
inet addr:192.168.1.111 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::230:58ff:fe57:12b3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2654 (2.5 KiB) TX bytes:3268 (3.1 KiB)
Interrupt:185

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

route output:[root@host1 ~]# route -nee
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0 0 0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 0 0 0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1 0 0 0
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0 0 eth0 0 0 0
This route output puzzles me quiet a bit. The 169.254.0.0 network on eth1 is strange. I've already deleted it once, but doing a network restart, it comes back. What's it for and can i get rid of it... or do I just leave it?

Also, my ISP gave me some settings to configure my server.
IP Range: 213.xxx.xxx.56/29
Default Gateway: 213.xxx.xxx.57
Netmask: 255.255.255.248
Nameservers: 194.xxx.xxx.135 and 136

The 213.xxx.xxx.56 and 213.xxx.xxx.63 (broadcast) are unusable. The 213.xxx.xxx.57 is the gateway and this leaves me 213.xxx.xxx.58 to 62. So I need to configure my server to these settings, but is that all I have to do?

Do I need to change my route table to match these settings? This, because when I take a look at my local gateway I see a lot of routes... and since the server is now behind my gateway, handling the routing, I was wondering if the server would need to do the same as soon as it's connect to the ISP's network. It's a 100Mbit connection straight to the internet, or so I'm told.

local gateway routing:

Flags Network Address Netmask Gateway Interface Metric
C 127.0.0.1 255.255.255.255 127.0.0.1 Loopback 1
C 224.0.1.134 255.255.255.255 192.168.1.2 LAN 1
S 0.0.0.0 0.0.0.0 83.160.x.1 WAN 1
C 83.160.x.0 255.255.255.0 83.160.x.x WAN 1
C 192.168.1.0 255.255.255.0 192.168.1.2 LAN 1
This gateway routes to a DSL-modem (192.168.1.1) but is configured as a straight-through modem.

Please give me some advise on how to do this fool-proof, since I have to drive up and down to Amsterdam (2 hours) to fix it, if it does not work!

Thanks

ps. I've posted earlier about this problem, but I desided then to bring my baby back home, reinstall the server with Fedora (instead of CentOS) and do some research about this problem. Hopefully this thread is a bit more clear and understandable for you... and especially for me!:D

Thx

freedog96150
6th July 2006, 08:05
This route output puzzles me quiet a bit. The 169.254.0.0 network on eth1 is strange. I've already deleted it once, but doing a network restart, it comes back. What's it for and can i get rid of it... or do I just leave it?

Do I need to change my route table to match these settings?

Please give me some advise on how to do this fool-proof, since I have to drive up and down to Amsterdam (2 hours) to fix it, if it does not work!


The 169.254.x.x IP's and routes are the default routes that a computer uses when it cannot establish its own IP via DHCP (that is, the DHCP server is missing). We can thank Microsoft for popularizing this IP range. If you want to research this further check out this rather dry definition at http://www.ietf.org/proceedings/00dec/I-D/draft-ietf-zeroconf-ipv4-linklocal-01.txt.

Now for the good part, YES, you can make this go away. I assume that you are either logging in at the console, or ssh'd into your server. Make sure that you are logged in as root. I am also going to assume (you did not specify) that the eth0 interface is going to be your EXTERNAL interface. If not, then simply substitute eth1 everywhere I list eth0.

root@ORC1 [/]# cd /etc/sysconfig/network-scripts/
root@ORC1 [/etc/sysconfig/network-scripts]# vi ifcfg-eth0

*The contents of the ifcfg-eth0 with the pertinent change is BOLD*
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
MTU=1500
NETMASK=255.255.255.248
BROADCAST=1.2.3.4
IPADDR=1.2.3.4
NETWORK=1.2.3.4
ONBOOT=yes
NOZEROCONF=yes

Save the file and make the same changes to the ifcfg-lo and ifcfg-eth1 files as well. Restart networking.

root@ORC1 [/etc/sysconfig/network-scripts]# service network restart

Now try your route print and you will see that the 169.254.x.x routes are gone. Unless something has changed drastically in FC5, this is the way it was in older versions.

Now would be a great time to setup your other IP's as well. Are you familiar with setting up ip aliases??

To answer your other question, you should not have to add entries to your route table unless you are indeed part of a larger VLAN. If your ISP is providing you a direct link, then this is most likely NOT the case. If the server is housed in a colo center, than, yes, you most likely have some work to do on the route tables. Your ISP will be best prepared to answer these questions as they *should* have knowledge of their network.

Oh yeah, make sure that you setup SSH to access your box. With 5 IP's, assign one as an administrative IP that you vow to NEVER change. That leaves you 4 IP's to use for your servers, services, etc. This will effectively limit your drive time to administer your server because your access is never compromised. Make sure that the firewall is duly configured for external access.

Hope this helps!
Brian

d3m0nic
6th July 2006, 10:18
Thanks for the reply.

The "NOZEROCONF=yes" and "MTU=1500" is new to me. I also noted "DNSPEER=yes" some times in a couple of threads. I searched the man pages on my system and the net, but I can't find adiquate information on what more can be set in ifcfg-eth0?

Also, i now understand that my ifcfg-eth0 needs to look like:
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth0
MTU=1500
NETMASK=255.255.255.248
BROADCAST=213.xxx.xxx.63
IPADDR=213.xxx.xxx.58
NETWORK=213.xxx.xxx.56 <--- (?)
ONBOOT=yes
NOZEROCONF=yes
...and my ifcfg-et1:
BOOTPROTO=none
TYPE=Ethernet
DEVICE=eth1
MTU=1500
NETMASK=255.255.255.248
BROADCAST=213.xxx.xxx.63
IPADDR=213.xxx.xxx.59
NETWORK=213.xxx.xxx.56 <--- (?)
ONBOOT=yes
NOZEROCONF=yes
(?) I'm not sure to put 213.xxx.xxx.56 or 213.xxx.xxx.0

Thanks,

falko
6th July 2006, 12:38
You can check your network settings with www.subnetmask.info :)

d3m0nic
15th July 2006, 18:56
Hello,

It's been a while, but i finally "hacked" ;) it. I've managed to get it all going... this makes me happy and sad at the same time. Thinking of it, makes me realize that i'm an idiot, thinking a new install of CentOS and destroying a load of work would solve the problem. Even jumping to a different distro, e.g. Fedora because of it's enormous user-base, wasn't the solution either. Eventually I went back to CentOS, being more stable due to it's conservative policies, regarding new patches and updates.

The solution was quite simple, but confusing. First I installed CentOS 4.2 with X and some Gnome stuff. Then i changed the eth0 from 192.168.1.110 to the new IP, 213.xxx.xxx.58, gateway 213.xxx.xxx.57 and the rest. using "system-config-network" which started a Gnome window. (handy-stuff)

I decided to leave eth1 as it was, 192.168.1.111, gw 192.168.1.254 (prev. 192.168.1.2) and transported the machine to my DataCenter. I decided to leave my laptop at home and use the local equipment at the DC.

Hooked it all up and... no dice! Looked at my routes with "route -nee" and my gateway was still 192.168.1.254! :confused:

Checked my network configuration again and eth0 had a different gateway as eth1, but still the system was using only one gateway... the gateway of eth1 (192.168.1.254)! I don't understand why the system doesn't have 2 gateways as I configured, one for each NIC. It seems that the system can only use one gateway and it's eth1's gateway.

anyway, not to fuss about it anymore as i did, i decided to changed eth1 to 213.xxx.xxx59 and gw 213.xxx.xxx.57 and it works OK now... time to install ISPConfig! :)

ps. configuring the NIC's via SSH, using "system-config-network" is possible, but only shows one NIC, eth0. I can not change eth1... is that normal?

thanks,

falko
16th July 2006, 13:04
ps. configuring the NIC's via SSH, using "system-config-network" is possible, but only shows one NIC, eth0. I can not change eth1... is that normal?

Not quite sure... But do you really have two NICs, or is your second IP address a virtual one? What's the output of ifconfig?

d3m0nic
16th July 2006, 17:10
Thanks falko for your intrest in this matter... here's the output of ifconfig:
[root@host1 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:40:58:57:12:B2
inet addr:213.xxx.xxx.58 Bcast:213.xxx.xxx.63 Mask:255.255.255.248
inet6 addr: fe80::230:58ff:fe57:12b2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13056 errors:0 dropped:0 overruns:0 frame:0
TX packets:17689 errors:0 dropped:0 overruns:0 carrier:0
collisions:11 txqueuelen:1000
RX bytes:1139135 (1.0 MiB) TX bytes:2212192 (2.1 MiB)
Interrupt:185

eth1 Link encap:Ethernet HWaddr 00:40:58:57:12:B3
inet addr:213.xxx.xxx.59 Bcast:213.xxx.xxx.63 Mask:255.255.255.248
inet6 addr: fe80::230:58ff:fe57:12b3/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:193

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8983 errors:0 dropped:0 overruns:0 frame:0
TX packets:8983 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3013309 (2.8 MiB) TX bytes:3013309 (2.8 MiB)

I'm a 1000% (thousand) sure the machine has two NIC's and you'll be too, when seeing the attachment.:D

d3m0nic
16th July 2006, 17:17
Also, using system-config-network via SSH shows me only one NIC... eth0. I also had Fedora once installed and strange as it may be, that only showed me eth1?!?! :confused:

If i change the name and device to eth1, the ifcfg-eth0 file is being changed and gets me even more in trouble. restarting the network, results in more error messages... which is obvious, coss the system they has two eth1's.

Maybe it's me that gets confused about eth0 (HWaddr 00:40:58:57:12:B2) being LAN 1 and eth1 (HWaddr 00:40:58:57:12:B3) being LAN 2... maybe it's the otherway round. I haven't tested that yet. It seems obvious though, that B2 is the first and B3 the second...

d3m0nic
16th July 2006, 17:34
I've discovered that installing a graphical interface results in a more elaberate ifcfg-ethx files:

DEVICE=eth0
BOOTPROTO=none
BROADCAST=213.222.13.63
HWADDR=00:40:58:57:12:B2
IPADDR=213.xxx.xxx.58
NETMASK=255.255.255.248
NETWORK=213.xxx.xxx.56
ONBOOT=yes
TYPE=Ethernet
GATEWAY=213.xxx.xxx.57
USERCTL=no
IPV6INIT=no
PEERDNS=yes

DEVICE=eth1
BOOTPROTO=none
BROADCAST=213.xxx.xxx.63
HWADDR=00:40:58:57:12:B3
IPADDR=213.xxx.xxx.59
NETMASK=255.255.255.248
NETWORK=213.xxx.xxx.56
ONBOOT=yes
TYPE=Ethernet
GATEWAY=213.xxx.xxx.57
USERCTL=no
IPV6INIT=no
PEERDNS=yes

The lines with USERCTL, IPV6INIT and PEERDNS are new to me and do not show when you'll install CentOS without GUI.

Anyway, my two cents on this subject is to always install your server at the datacenter with a monitor, keyboard and mouse (using GUI), instead of hooking up a laptop using a crosslinked cable and trying to figure out what is wrong to get things going... it was a hard lesson to figure that on out! hahaha!

falko
17th July 2006, 15:47
I'm a 1000% (thousand) sure the machine has two NIC's and you'll be too, when seeing the attachment.:D
Yes, I'm convinced now that you have two NICs. :)