Tag Archives: F5
INOPERATIVE in Bash F5
Activate F5 License using CLI
-Cut and Paste to F5 License Activation site https://activate.f5.com/license/dossier.jsp



Retype new BIG-IP password:
After you see login prompt and login, please wait 3min.
The status will change from
[root@localhost:INOPERATIVE:Standalone]/#
to
[root@localhost:Active:Standalone]/#
# tmsh show /sys license
Sys::License
Licensed Version 11.6.0
Block XSS in ASM
Download Hack-It from https://www.dropbox.com/sh/09dkjicaes2hygo/AABSGBaJ3H1N8_C2uMLwSVGNa
iface eth0 inet static
address 10.0.20.60
netmask 255.255.255.0
gateway 10.0.20.1
-Create Pool PoolAuction
-Create VsAuction Security Policy
go to Security/Application Security/Security Policies/Active Policies
click Create
Go to Security/Application Security/Attack Signature/Attack Signature Configuration

In your browser, go to https://10.0.15.60
and Type “‘ or 1=1#” (without double quotes” in login
the result is
iRule Example
1. PoolRedirectHTTP iRule
-Prepare 2 pools PoolWWW and PoolWWW2
PoolWWW
Health Monitor http
Members: WWW1 10.0.20.51 80
WWW2 10.0.20.52 80
PoolWWW2
Health Monitor http
Members: WWW3 10.0.20.53 80
WWW4 10.0.20.54 80
-Prepare 1 Virtual Server VsWWW
VsWWW
Destination Address: 10.0.15.50
Service Port: 80 HTTP
Protocol: TCP
Protocol Profile (Client): tcp
Protocol Profile (Server): (Use Client Profile)
HTTP Profile: None
VLAN and Tunnel Traffic: All VLANs and Tunnels
Source Address Translation: Auto Map
click Resources
Default Pool: PoolWWW
Download and install F5 iRule Editor from
https://devcentral.f5.com/d/irule-editor
Launch iRule Editor
Hostname: F5ipaddress 443
Endpoint: /iControl/iControlPortal.cgi
Username: admin
Password:
click OK
click File/New
Name: PoolRedirectHTTP
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals “10.0.10.110”] } {
pool PoolWWW }
else {
pool PoolWWW2 }
}
-Assign PoolRedirectHTTP iRule into VsWWW Virtual Server
click Virtual Servers VsWWW
click Resources
click iRules/Manage
Enabled PoolRedirectHTTP
click Finished
-Test
Now when you access http://10.0.15.50 from your browser and your ip is 10.0.10.110, you will get pool PoolWWW, otherwise PoolWWW2
2. Redirect2HTTPS iRule
-Prepare 2 pools PoolWWW and PoolWWWS2
PoolWWW
Health Monitor http
Members: WWW1 10.0.20.51 80
WWW2 10.0.20.52 80
PoolWWWS2
Health Monitor https
Members: WWW3 10.0.20.53 443
WWW4 10.0.20.54 443
-Prepare 1 Virtual Server VsWWW
VsWWW
Destination Address: 10.0.15.50
Service Port: 0 *All Ports
Protocol: TCP
Protocol Profile (Client): tcp
Protocol Profile (Server): (Use Client Profile)
HTTP Profile: None
VLAN and Tunnel Traffic: All VLANs and Tunnels
Source Address Translation: Auto Map
click Resources
Default Pool: PoolWWW
run F5 iRule Editor
click File/New
Name: Redirect2HTTPS
when CLIENT_ACCEPTED {
if {[TCP::local_port] == 80} {
pool PoolWWW
}
elseif { [TCP::local_port] == 443 } {
pool PoolWWWS2
}
}
-Assign Redirect2HTTPS iRule into VsWWW
click Virtual Servers VsWWW
click Resources
click iRules/Manage
Enabled Redirect2HTTPS
click Finished
-Tes
Now when you access http://10.0.15.50 from your browser, you will get pool PoolWWW
If using https://10.0.15.50, you will get PoolWWWS2
if {[HTTP::uri] ends_with “txt”} {
pool PoolWWW2
}
else { pool PoolWWW }
}
If using http://10.0.15.50, you will get PoolWWW
Overview of port lockdown behavior
SOURCE: https://support.f5.com/kb/en-us/solutions/public/13000/200/sol13250.html
Allow Default
This option allows access for a pre-defined set of network protocols and services that are typically required in a BIG-IP deployment.
# tmsh list net self-allownet self-allow {
defaults {
ospf:any
tcp:domain
tcp:f5-iquery
tcp:https
tcp:snmp
tcp:ssh
udp:520
udp:cap
udp:domain
udp:f5-iquery
udp:snmp
}
}
Allow All
This option specifies that all connections to the self IP address are allowed, regardless of protocol or service.
Allow None
This option specifies that no connections are allowed on the self IP address, regardless of protocol or service.
However, ICMP traffic is always allowed, and if the BIG-IP systems are configured in a redundant pair, ports that are listed as exceptions are always allowed from the peer system.
This option allows you to specify the protocols and services for which connections are allowed on the self IP address.
However, ICMP traffic is always allowed, and if the BIG-IP systems are configured in a redundant pair, ports that are listed as exceptions are always allowed from the peer system
Using the Configuration utility to modify port lockdown settings for a specific self IP
Log in to the Configuration utility.
Navigate to Network > Self IPs.
Click the relevant self IP address.
From the Port Lockdown box, select the desired setting.
Click Update.
Using the tmsh utility to modify port lockdown settings
#tmsh
#modify /net self 10.10.10.1 allow-service default
#save sys config
Setting up Basic Web Server Load Balance
CLI
-set hostname
#tmsh modify sys global-settings hostname f51.poc.com
#tmsh create net vlan DMZ interfaces add {1.1}
#tmsh create net vlan SVR interfaces add {1.2}
-Create Self IPs
#tmsh create net self 10.0.15.231/24 allow-service add { icmp:any } vlan DMZ
#tmsh create net self 10.0.20.231/24 allow-service add { icmp:any } vlan SVR
-Create PoolWWW Pool
# tmsh create ltm pool PoolWWW load-balancing-mode round-robin members add {WWW1:80 WWW2:80} monitor http
#tmsh create ltm virtual VsWWW destination 10.0.15.50:80 profiles add {tcp http} pool PoolWWW snat automap
-Save the config
#tmsh save sys config
Generate Support Snapshot file
Cyberoam:
GUI
Go to System/Diagnostics/CTR
tick Log and type your Reason
click Generate
F5:
GUI
Log in to the Configuration utility.
Expand the System menu.
Click Support.
The QKView option is already selected.
Click the Start button.
When prompted, click the Download Snapshot File button to download the output file.
CLI
# qkview
Gathering System Diagnostics: Please wait …
Diagnostic information has been saved in:
/var/tmp/f51.poc.com.qkview
Please send this file to F5 support.
Changing F5 Logo
SOURCE: https://devcentral.f5.com/questions/how-i-can-costumize-logo-on-gui-interface
NOTE: When I revert back to original logo, it appear broken although md5 of the logo is correct.
And this method only change Welcome message logo but not F5 logo after you login
Log in to the BIG-IP command line.
1. Remount the /usr file system in read-write mode by typing the following command:
#mount -o remount,rw /usr
2. Change to directory logo_f5.png
#cd /usr/local/www/tmui/tmui/login/images
3. Backup F5 default logo
#cp logo_f5.png logo_f5.png.orig
4. Upload similar sized logo that you created give it name (“logo_f5.png”) to the same directory, You might want to use WINSCP.
5. Check your login page it should be changed.
6. Modify the file held on the /usr file system.
Remount the /usr file system in read-only mode by typing the following command:
#mount -o remount,ro /usr
Restrict SSH access
Cyberoam:
GUI
Go to SYSTEM/Administration/Appliance Access
F5:
SOURCE: https://support.f5.com/kb/en-us/solutions/public/5000/300/sol5380.html
CLI
Log in to the command line.
Use the following command syntax:
tmsh modify sys sshd allow add { or }
For example, to add the 192.168.1.245 IP address to the existing list of IP addresses that are allowed to log in to the system, type the following command:
tmsh modify sys sshd allow add { 192.168.1.245 }
To create an initial range of IP addresses (192.168.0.0 with a netmask of 255.255.0.0) that are allowed to log in to the system, type the following command:
tmsh modify sys sshd allow add { 192.168.0.0/255.255.0.0 }
Save the configuration by typing the following command:
tmsh save sys config
GUI
-open GUI
– go to System/Platform/SSH IP Allow