Archive for the ‘ Network ’ Category

Adding a Secondary Gateway / Static Route in Linux

In order to create a static Route you can enter the following command :

ip route add 192.168.1.0/24 via 192.168.1.254 dev eth0

or

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth1

Note : In order to make this permanent, you would have to create a file named routes-eth0

vi /etc/sysconfig/network-scripts/route-eth0

Append the following line to the file, if the file does not exist , create new file

192.168.1.0/24 via 192.168.1.254

You could also have something like this :

GATEWAY0=192.168.1.254 NETMASK0=255.255.255.0 ADDRESS0=192.168.1.0 GATEWAY1=10.10.1.0

NETMASK1= 255.255.255.240 ADDRESS1=10.10.1.254

Installing Vnc Server on Linux Machine without monitor

Vnc Installation Without Monitor

Packages Required :

1.vnc

2.vnc-server

3.Desktop Environment KDE or GNOME

Configuring VNC :

1. Add users like normal users.

2. login to each users

3. create password by running vncpasswd

4. It creates .vnc folder

5. Edit /etc/sysconfig/vncservers, and add the following to end of the file

VNCSERVERS="1:amitn 2:someuser"

VNCSRVERARGS[1]="-geometry 640×480"  ( for amitn )

VNCSRVERARGS[2]="-geometry 640×480"  ( for someuser)

VNCSRVERARGS[1]="-geometry 800×600"

6.Create Xstartup scripts by starting and stopping vncserver as root

/sbin/service vncserver start

/sbin/service vncserver stop

7. Login to each user and edit xstartup script

8. vi .vnc/xstartup

#!/bin/sh

# Add the following line to ensure you always have an xterm available.

( while true ; do xterm ; done ) &

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER

exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] &&

exec /etc/vnc/xstartup [ -r $HOME/.Xresources ]

&& xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" & startkde &

Adding Multiple IP Address to A NIC Card

It is possible to bind more than one ip address on a single network interface card in linux.

copy your existing network card  configuration file as shown:

#cd /etc/sysconfig/network-scripts
#cp ifcfg-eth0 ifcfg-eth0:1

>>ifcfg-eth0 looks like this :

# File: ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.1
NETMASK=255.255.255.0
BROADCAST=192.168.100.255
NETWORK=192.168.100.0
HWADDR=00:8A:4E:34:CF:84

Change the device name and the ip address parameters

File : ifcfg-eth0:1
and
DEVICE=eth0:1

#save the fiel and then restart the network

#service network restart