Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, October 9, 2012

Ncat HTTP Proxy

[root@localhost Downloads]# uname -a
Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost Downloads]# 
[root@localhost Downloads]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.3 (Santiago)
[root@localhost Downloads]# 
[root@localhost Downloads]# ls -l
total 892
-rw-r--r--. 1 root root 909460 Oct  9 15:37 ncat-6.01-1.x86_64.rpm
[root@localhost Downloads]# 
[root@localhost Downloads]# rpm -vhU ncat-6.01-1.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:ncat                   ########################################### [100%]
[root@localhost Downloads]# 
[root@localhost Downloads]# which ncat
/usr/bin/ncat
[root@localhost Downloads]# 
[root@localhost Downloads]# netstat -an | grep 8080
[root@localhost Downloads]# 
[root@localhost Downloads]# ncat -l 8080 --proxy-type http &
[1] 28406
[root@localhost Downloads]# 
[root@localhost Downloads]# ps -ef | grep ncat
root     28064     1  0 15:38 ?        00:00:01 gedit /root/Desktop/ncat
root     28406 27911  0 15:46 pts/0    00:00:00 ncat -l 8080 --proxy-type http
root     28408 27911  0 15:46 pts/0    00:00:00 grep ncat
[root@localhost Downloads]# 
[root@localhost Downloads]# netstat -an | grep 8080
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      
tcp        0      0 :::8080                     :::*                        LISTEN      
[root@localhost Downloads]# 
[root@localhost Downloads]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:BC:40:01  
          <span style="background-color: #fdff7b;">inet addr:192.168.18.101</span>  Bcast:192.168.18.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:febc:4001/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13042 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2318 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2924825 (2.7 MiB)  TX bytes:761972 (744.1 KiB)

[root@localhost Downloads]# 



[root@localhost Downloads]# netstat -an | grep 8080
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      
tcp        0      0 192.168.18.101:8080         192.168.18.1:5929           ESTABLISHED 
tcp        0      0 192.168.18.101:8080         192.168.18.1:5927           TIME_WAIT   
tcp        0      0 :::8080                     :::*                        LISTEN      
[root@localhost Downloads]# 
[root@localhost Downloads]# ps -ef | grep ncat
root     28064     1  0 15:38 ?        00:00:01 gedit /root/Desktop/ncat
root     28406 27911  0 15:46 pts/0    00:00:00 ncat -l 8080 --proxy-type http
root     28424 27911  0 15:47 pts/0    00:00:00 grep ncat
[root@localhost Downloads]# 

Note: Make sure that the Linux iptables firewall is disabled or permit TCP/8080.

Monday, October 8, 2012

Setup Wireshark on Red Hat Enterprise Linux 5.8

Before:

1. Insert the RHEL/5.8 i386 DVD.
2. Issue the following commands in sequence.
rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/libsmi-0.4.5-2.el5.i386.rpm
rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/wireshark-1.0.15-1.el5_6.4.i386.rpm
rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/wireshark-gnome-1.0.15-1.el5_6.4.i386.rpm

3. Command outputs:
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-308.el5 #1 SMP Fri Jan 27 17:21:15 EST 2012 i686 i686 i386 GNU/Linux
[root@localhost ~]#
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
[root@localhost ~]#
[root@localhost ~]# rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/libsmi-0.4.5-2.el5.i386.rpm 
warning: /media/RHEL_5.8 i386 DVD/Server/libsmi-0.4.5-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:libsmi                 ########################################### [100%]
You have new mail in /var/spool/mail/root
[root@localhost ~]# 
[root@localhost ~]# rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/wireshark-1.0.15-1.el5_6.4.i386.rpm 
warning: /media/RHEL_5.8 i386 DVD/Server/wireshark-1.0.15-1.el5_6.4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:wireshark              ########################################### [100%]
[root@localhost ~]# 
[root@localhost ~]# rpm -vhU /media/RHEL_5.8\ i386\ DVD/Server/wireshark-gnome-1.0.15-1.el5_6.4.i386.rpm 
warning: /media/RHEL_5.8 i386 DVD/Server/wireshark-gnome-1.0.15-1.el5_6.4.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:wireshark-gnome        ########################################### [100%]
[root@localhost ~]# 

After:

Thursday, August 16, 2012

Changing MAC Address in Red Hat Enterprise Linux

Note:
Change the HWADDR to MACADDR.
This change is persistent across reboots.
Tested OK on RHEL 5.5.

[root@localhost /]# cat /etc/sysconfig/networking/devices/ifcfg-eth0 
# Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
MACADDR=00:0C:29:11:22:33
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.18.123
GATEWAY=192.168.18.1
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
[root@localhost /]# 
[root@localhost /]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:11:22:33  
          inet addr:192.168.18.123  Bcast:192.168.18.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe11:2233/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:562 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:54763 (53.4 KiB)  TX bytes:6646 (6.4 KiB)

[root@localhost /]# 

Friday, May 25, 2012

Red Hat Enterprise Linux 5.x LACP

[root@rhel5 ~]# uname -a
Linux egwgwcs 2.6.18-308.el5PAE #1 SMP Fri Jan 27 17:40:09 EST 2012 i686 i686 i386 GNU/Linux
[root@rhel5 ~]#
[root@rhel5 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
[root@rhel5 ~]#
[root@rhel5 ~]# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.1.101
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=4 miimon=100"
[root@rhel5 ~]#
[root@rhel5 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
MACADDR=00:10:18:a2:07:ac
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
[root@rhel5 ~]#
[root@rhel5 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
MACADDR=00:10:18:a2:07:ad
ONBOOT=yes
TYPE=Ethernet
MASTER=bond0
SLAVE=yes
[root@rhel5 ~]#
[root@rhel5 ~]# ls -l /etc/sysconfig/networking/devices
total 0
[root@rhel5 ~]#

Reboot the server.
Note: not modifying anything in /etc/modprobe.conf and /etc/rc.d/rc.local

[root@rhel5 ~]# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:10:18:A2:07:AC
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::210:18ff:fea2:7ac/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:17420591 errors:0 dropped:0 overruns:0 frame:0
          TX packets:545949 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4014084008 (3.7 GiB)  TX bytes:178162877 (169.9 MiB)

eth0      Link encap:Ethernet  HWaddr 00:10:18:A2:07:AC
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:16901178 errors:0 dropped:0 overruns:0 frame:0
          TX packets:505049 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3914119872 (3.6 GiB)  TX bytes:172584206 (164.5 MiB)
          Interrupt:177

eth1      Link encap:Ethernet  HWaddr 00:10:18:A2:07:AC
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:519413 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40900 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:99964136 (95.3 MiB)  TX bytes:5578671 (5.3 MiB)
          Interrupt:130

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:7821740 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7821740 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2779914013 (2.5 GiB)  TX bytes:2779914013 (2.5 GiB)

[root@rhel5 ~]#
[root@rhel5 ~]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: IEEE 802.3ad Dynamic link aggregation
Transmit Hash Policy: layer2 (0)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

802.3ad info
LACP rate: slow
Active Aggregator Info:
        Aggregator ID: 1
        Number of ports: 2
        Actor Key: 17
        Partner Key: 32925
        Partner Mac Address: 00:23:04:ee:be:01

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:10:18:a2:07:ac
Aggregator ID: 1

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 1
Permanent HW addr: 00:10:18:a2:07:ad
Aggregator ID: 1
[root@rhel5 ~]#

Please leave a comment if this is working for you too. Thanks. :-)