Saturday, November 4, 2017

Access to local dhcp server via ssh




I constructed dhcp server on centOS6 (which has a ipaddress 192.168.0.0)
to allocate ip address, 192.168.0.5, to other local node.



When i use "service network restart" on client node and type ifconfig, the client node show their allocated ip (192.168.0.5) and subnetmask (255.255.255.0)




However When i try to access dhcp server from client node using ssh (hostname)@192.168.0.5, the terminal just show "ssh: connect to host 192.168.0.0 port 22: Network is unreachable".



what's wrong with my concept? I can't even guess.
Below are my configuration files.



/etc/sysconfig/network-script/ifcfg-eth0 on server



TYPE="Ethernet"
BOOTPROTO=static

NAME="eth0"
UUID=(UUID on server)
ONBOOT="yes"
IPADDR0=192.168.0.0
NETMASK=255.255.255.0
HWADDR=(MAC address on server)


/etc/sysconfig/network-script/ifcfg-eth0 on client




TYPE="Ethernet"
BOOTPROTO=dhcp
NAME="eth0"
UUID=(UUID on client ethernet)
ONBOOT="yes"
HWADDR=(MAC address on client ethernet)


/etc/dhcp/dhcpd.conf




subnet 192.168.0.0 netmask 255.255.255.0 {

host node2 {
hardware ethernet (Mac address on client ethernet);
fixed-address 192.168.0.5;
}

}

Answer




You can't use 192.168.0.0 as the IP address on the router / DHCP server.



With a /24 subnet (netmask 255.255.255.0) the first usable IP address is 192.168.0.1.



For more information as to why see this previous Q&A.


windows - A require a server hosting package that would be suitable for several .net managed applications, accessed only by me



I currently run a server at home consisting of




  • SQL Server 2008

  • .net Framework 2010

  • VPN Connection

  • ASP.net Web Services




running around 5-6 applications supporting a financial trading system that i regularly use. THe only user is me.
Recently the requirement to have these applications running in a 24/7 100% uptime (or 99%) environment has become important. No longer can I both meet this requirement and host my server at home on my network - so i am looking to move to a dedicated hosting company.



After some research, the only real companies I can find offering such services are geared towards company web-space hosting. I don't need 1TB+ bandwidth, what i need is CPU, Memory and as much control over the environment as possible.



Does anyone have any examples of such a service?



Thanks in advance.


Answer




Buy a server. Put it in a hosting center. This is called colocation.


Bringing Linux Accounts in Active Directory

I'm trying to centralize user login information via Active Directory. Currently I have AD running on Server 2008 R2. I do have Identity Management for UNIX installed on it. I also have a few Linux clients mainly using CentOS 5.X and Fedora 14. I've set up Samba on a CentOs machine and have joined the machines to the AD domain. Users in AD are able to login to Linux clients using the AD credentials. My question is that is it possible for the Linux users to login to Windows machines. I'm new to setting up integration as well Samba. Is there any setting in Samba that'll allow the users in Linux machines to login to Windows? I'd appreciate any help/tips/suggestions. Thank you very much.

Friday, November 3, 2017

Why the performance decrease for an SSD when using Hyper-V?

I've just installed my new M4 256GB on a Windows Server 2008 R2 Hyper-V server.




On the host system using Crystal Disk Mark I've got 212 Mb/s as 4k QD32 write performance, but when I create a VHD disk on the SSD and test using the same configuration on a guest Windows Server 2008 R2, I get 7 Mb/s, i.e. about 30 times slower.



Any hint?



Of course Fixed size vhd

postfix - Mailserver and MX records in Cloudflare




I built my own mail server using postfix/dovecot in CentOS 6, this is my postconf -n results:



alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2

home_mailbox = Maildir/
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = example.com
myhostname = mail.example.com

mynetworks = 168.100.189.0/28, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains =
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550



I've tried using telnet to test my emails and I do get them in the /home/user/Maildir/new folder.



I assume everything is OK with the mail server, so I went ahead and added MX records to my DNS settings.



This is the first time I've used Cloudflare's free DNS service, and I admit to not being the most knowledgeable person when it comes to this, but I added a couple of records in there:




  • MX - @ => mail.example.com


  • A - mail.example.com => My VPS ip (where the mail server is located)



The MX record seems to be in place, a quick "dig MX example.com" does wield a result. The problem now is... even though I created the record as mail.example.com, the actual entry as seen via dig is dc-8c1937cd-mail.example.com., a string seems to have been appended to the DNS record.



I've since tried sending email from an outside source (not telnet) without success. Do I need to reconfigure postfix and set myhostname as dc-8c1937cd-mail.example.com.? Am I missing something here in the grander scheme of DNS or is this just the way Cloudflare operates? Could my mailserver not be configured correctly? (logs from my telnet tests look fine)


Answer



Issue was inet_interfaces = localhost, causing postfix only to listen port 25 locally, setting it to inet_interfaces = all fixed the issue.


windows - How to Monitor Bandwidth usage in real terms

I have a small (windows) network with a few people on it.



We have internet access via a BT router



Generally things are all fine, but occasionally, we seem to experience a dramatic loss of bandwidth.



I could be suffering from a zombie PC or a user running torrent software... Or I could simply have some kind of restriction being placed on my by my ISP?



I want to find out what is going on.




Is there a simple tool which I can run to give me a real world (Which Apps on Which PCs) are using all the bandwidth at any given point?

Nginx rewrite prevent redirection

I am trying to make a url rewrite as following:



 location /statics/ {

alias /var/project/statics/;
}
location /statics/cache {
rewrite /statics/cache/(.*?)/(.*)$ http://$host/statics/$2 last;
}


Where URL would be as:
http://ANY-DOMAIN.com/statics/cache/1.2.5/file/path/file.js
The original file is:
http://ANY-DOMAIN.com/statics/file/path/file.js



The problem here is:

URL is redirecting (changing URL) to original file. I want to prevent the redirection.



Current status:
Redirects to original URL

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...