Categories
Linux

Centos 6 multiple vlans with one eth device

UPDATED for CentOS 7:

CentOS 7 multiple VLANs on one interface

The scenario I had was 1 eth0 device, and my port trunk’d to allow 9 and 10 vlans. I wanted to assign the full /24 to this box, using only eth0 and the trunk port in CentOS 6. This is what I had to do.

in linux NEED eth0 and one VLAN’d CFG:

cd /etc/sysconfig/network-scripts/

ifcfg-eth0.9 the .9 is the vlan

# Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express
DEVICE=eth0.9
BOOTPROTO=none
HWADDR=00:1d:xx:xx:xx:xx
ONBOOT=yes
TYPE=Ethernet
IPADDR=173.243.116.2
NETMASK=255.255.255.0
VLAN=yes

ifcfg-eth0.10

# Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express
DEVICE=eth0.10
BOOTPROTO=none
HWADDR=00:1d:xx:xx:xx:xx
ONBOOT=yes
TYPE=Ethernet
IPADDR=173.243.117.2
NETMASK=255.255.255.0
VLAN=yes

ifcfg-eth0
# Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:1d:xx:xx:xx:xx
ONBOOT=yes
TYPE=Ethernet

ifcfg-eth0.9-range0
IPADDR_START=173.243.116.3
IPADDR_END=173.243.116.254
NETMASK=255.255.255.0
CLONENUM_START=3

ifcfg-eth0.11-range0
IPADDR_START=199.96.80.3
IPADDR_END=199.96.80.254
NETMASK=255.255.255.0
CLONENUM_START=257

******************************************************************************************

CENTOS 6 REQUIRES NO GATEWAY in ifcfg-eth0.xx so remove it

CENTOS 6 REQUIRES ROUTES ADDED:

You can do this to test, as once the server is rebooted, or network restarted these rules drop:
ip route add default via 192.119.164.1 dev eth0.8 table 1
ip route add default via 192.119.165.1 dev eth0.9 table 2
ip rule add from 192.119.164.2 tab 1 priority 500
ip rule add from 192.119.165.2 tab 2 priority 501
ip rule add from 192.119.164.0/24 table 1
ip rule add from 192.119.165.0/24 table 2

To make it permanent:
cd /etc/sysconfig/network-scripts/

echo ‘default via 192.119.169.1 dev eth0.3 table 1’ > route-eth0.3
echo ‘default via 192.119.174.1 dev eth0.6 table 2’ > route-eth0.6
echo ‘from 192.119.169.2 tab 1 priority 500’ > rule-eth0.3
echo ‘from 192.119.174.2 tab 2 priority 501’ > rule-eth0.6
echo ‘from 192.119.169.0/24 table 1’ > rule-eth0.3
echo ‘from 192.119.174.0/24 table 2’ > rule-eth0.6

******************************************************************************************

Categories
Linux

history command with timestamp linux

I always find it easier when my history has a time stamp, you can coorolate a lot of things, like last, start/stops of services, who done it, etc.

export HISTTIMEFORMAT=”%F %T ”

This will work for the session, but if you want it saved for every log in add to respective bash_profile:
~/.bash_profile or /root/.bash_profile

Categories
Linux

Firewall Status: Enabled but Stopped in CSF with cPanel

I kept getting: Firewall Status: Enabled but Stopped in my CSF in cPanel. I am currently running WHM 11.40.1 (build 11) and csf v7.03.

I tried just clicking start, no luck it would just flip back a few minutes later. So I ended up dropping to shell and running

service csf stop
iptables –flush
service csf start

that seemed to work, there must have been a hung iptables rule, or a bad rule that caused CSF to flip to disabled.

Categories
linux Operating System Deployment

error when copying or overwriting the same directory name linux

my directory structure in linux – centos:

/home/html/prod/wordpress/update/
/home/html/prod/wordpress/

/wordpress/ is my wordpress install, and /update/ is my unziped download files and directories.

The errors I kept getting when trying to move or copy the entire directory while sitting in /home/html/prod/wordpress/update/ was:

mv: cannot move `wp-admin’ to a subdirectory of itself, `../wp-admin’
mv: cannot move `wp-content’ to a subdirectory of itself, `../wp-content’

cp: omitting directory `wp-admin’
cp: omitting directory `wp-content’

what I ended up doing was staying in the same directory ( /home/html/prod/wordpress/update ) and running:

cp -fR * ../

f = force
R = recursive

all went well, replaced the entire directory like I wanted and I just removed the /update directory and done.

Categories
Linux

how to disable RHN in linux – red hat or centos

What I did to disable it was go to: /etc/sysconfig/rhn

and delete all of the files in it. If you want to re-enabled it after, you can just copy the files back, so you may want to copy them to a location you want to keep them at.

Categories
Linux

How to get external ip via linux command line

wget -O - -q icanhazip.com

you will get a very easy looking readout

example:

root@madhost419 [~]# wget -O - -q icanhazip.com
74.122.196.130
root@madhost419 [~]#

or via curl:

curl http://www.cPanel.net/showip.cgi

Categories
Uncategorized

change CSGO crosshair to pink

PINK CROSS HAIR COMMANDS:

cl_crosshaircolor 5 (This tells the game you want to create a custom colour using the RGB values)

cl_crosshaircolor_r 255
cl_crosshaircolor_g 0
cl_crosshaircolor_b 255

cl_crosshairthickness 1 (This sets the thickness of the cross hair lines, default is 0.5)

cl_crosshairgap 0 (This sets the distance of the gap between the cross hair, default is 0)

cl_crosshairdot 1 (This adds a centre dot to the middle of the cross hair, default is 0)

cl_crosshairalpha 255 (This makes the cross hair totally solid with less transparency, default is 200)

Categories
Linux

removing the limit of 100 rows in squirrel

Using the squirrel app: http://www.squirrelsql.org/ I had issues with only seeing 100 rows in a table. I fixed this by going to File -> New Sessions Properties -> Object Tree -> Contents -> limit rows. The default is 100, but you can uncheck it and you should be good.

If not, you can also do the same under New Sessions Properties -> SQL -> SQL Results – limit rows. Then uncheck it and hit OK.

That worked for me!

Categories
Operating Systems Windows 8

alt f4 on surface pro with type keyboard 2

I couldn’t get alt f4 working on any of my apps on my new microsoft surface pro with type keyboard 2. It ended up being that my function lock was set! I had to unlock that via: function + caps lock (Thanks rsutoratosu on Anandtech). And now ALT F4 works, time to go kill some apps!

Categories
Computer Hardware

bitfeniex prodigy with 7 hard drives

I bought this bitfenix prodigy case for about $30 off craiglist, someone didn’t like that it was white, and for $30, couldn’t be beat for this case. As it was retailing for about $80 at newegg/microcenter. I was going to build my girlfriend a new PC and thought ITX was the way to go, after building my own gaming rig on ITX, but using an SG05 ( linky to build ). We went to go look at some monitors at mirceoter, and ended up coming up with a sweet touch screen Dell for her. Nice and neat, and it saved us $1500 from buying an imac, LOL!

So what to do with this case, well, my current NAS was about 3~ years old, had about 2TBx7 HDD’s, and was running JBOD, so nothing fancy. It was a neat little water cooling server in an Antec 300, but I wanted to do something different. I actually had 7 WD 2TB RE4’s laying around not doing anything, so I thought lets build an awesome ITX NAS box! So here we are, throwing together a 7 HDD + 1 SSD NAS box running Windows 7.

I love building PC’s, and I love the fact I do it without cutting, or modding (maybe someday i’ll cut and mod), but I like to keep things stock as possible.

I purchased:

Adapec 5805 off ebay for $100, which has 2 8087’s internal, so I could use 2 fanouts for at least 8 drives. It also has 512MB of onboard memory for the raid 5 I wanted to do. Kicker was it came with a working BBU!

I also snagged a 150mm PSU that I read would fit nicely: Seasonic 360W 80PLUS Gold ATX12V Power Supply SSR-360GP
I got a Intel Pentium Processor G3220, nothing fancy, but it is a slight upgrade to my Q9550 that the server is currently running. No worries though, as I need ZERO cpu to RDP and just make sure everything is hunky dory.
I got a ASRock H81M-ITX, which is my first ASRock mobo, so far so good running this thing.
Couple with 4GBx2 DDR3 I had to purchase as well.

So far i’ll be using the intel CPU cooler, and might swap it out for something decent if I find this thing’s too loud.

I got some molex to SATA power adapters, as the PSU only came with 5 SATA power connectors. I also got some 8087 fanout cables I did not have, ran about $15 bucks for the 2 8087’s, and $10 for the 2x molex to sata connectors.

Swapped out the stock bitfenix brushless fans (model BFF-SCF-12025KK-RP) for my scythe SFLEX SFF21G’s hooked up to some devolts to 9v, so they’re nice and silent. I also purchased a nice bitfenix spectre 230mm fan, threw it up front to see it push some air. If this does not work, i’ll grab a 140mm or 120mm scythe i’ve got laying around and use that. I don’t need a LOT of airflow, but the more I can get while keeping silence would be great.

Here’s what 5 of my 6 drives look like … the SSD and other 2TB are in the 5.25″ bay.

[zp src=”P1040631.JPG” album=”blog/Bitfenix/” width=”600″]

I had one problem where I realized the 8087 connectors are a little tight … so I am not snapping in the 3 bay disk set as to not stress the card. This is what it looks like snapped in/stressed:

[zp src=”P1040629.JPG” album=”blog/Bitfenix/” width=”600″]

This is how i’ll leave it:

[zp src=”P1040630.JPG” album=”blog/Bitfenix/” width=”600″]