juniper srx - basic routing/transparent mode - networking

juniper firefly + basic static route in gns3.
Configuration is smilar in:
http://kb.juniper.net/InfoCenter/index?page=content&id=KB21421
I'm delete untrunt zone:
root# run show configuration
## Last commit: 2015-07-27 20:32:29 UTC by root
version 12.1X47-D20.7;
system {
root-authentication {
encrypted-password "$1$HtKID/TF$jteDsW8F17nSgIQj5e6KF0"; ## SECRET-DATA
}
}
interfaces {
ge-0/0/0 {
unit 0 {
family bridge {
interface-mode access;
vlan-id 10;
}
}
}
ge-0/0/1 {
unit 0 {
family bridge {
interface-mode access;
vlan-id 10;
}
}
}
irb {
unit 0 {
family inet {
address 172.27.186.63/24;
}
}
}
}
routing-options {
static {
route 0.0.0.0 next-hop 172.27.186.1
}
}
security {
policies {
from-zone trust to-zone trust {
policy 1 {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
}
bridge-domains {
test {
domain-type bridge;
vlan-id 10;
routing-interface irb.0;
}
}
ping 172.27.186.2->172.27.186.3 not work
ping 172.27.186.3->172.27.186.2 not work
ping 172.27.186. 2 or 3 -> 172.27.186.63 work.
I spent several hours and I do not see where the place is a problem.
This is a simple configuration to learn the rules and theoretically should work, but it is not.
Someone will say where is the error?
I made myself a static routing between 2 cisco routers - ping worked, I added between routers juniper-a and set similarly to the above is unfortunately also not working.
It does not operate even such a simple routing, where there are 2 commands:
youtube.com / watch?v=I9li31WvUA8
Thank you very much for any help

Try to set up default security policy to "permit-all":
security {
policies {
default-policy {
permit-all;
}
}
}
Try to create Security Zones if you haven't created it yet:
security {
zones {
security-zone Internal {
interfaces {
ge-0/0/0.0 {
host-inbound-traffic {
system-services {
ping;
ssh;
telnet;
all;
}
}
}
[...]
}
}
}
}

Related

how to make kamailio serial forking?

######################################################################################
I am a beginner in kamailio server development, and I want to make serial forking, but that doesn't work.
My kamailio server replies Too Many Hops (code: 483) and end the call.
can someone helps me please.
######################################################################################
I use this code :
request_route {
# per request initial checks
route(REQINIT);
# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans()) {
t_relay();
}
exit;
}
# handle retransmissions
if (!is_method("ACK")) {
if(t_precheck_trans()) {
t_check_trans();
exit;
}
t_check_trans();
}
if (is_method("INVITE|SUBSCRIBE")) {
record_route();
}
if(is_method("REGISTER"))
save("location");
# test serial forking
if (method=="INVITE") {
if(!t_is_set("branch_route")) route(SERIAL);
};
if(lookup("location")){
if (!t_relay()) {
sl_reply_error();
}
exit;
}
}
route[SERIAL]{
$ru = "sip:1001#192.168.50.131:5060";
xlog("ALERT : new request uri $ru \n");
t_on_failure("1");
t_relay();
}
failure_route[1] {
if(t_is_canceled()) {
exit;
}
xlog(" an other alternative \n");
if(t_check_status("486|408")){
$ru = "sip:1002#192.168.50.131:5060";
xlog(" an other uri $ru \n");
t_on_failure("2");
t_relay();
exit;
}
}
failure_route[2] {
if(t_is_canceled()) {
exit;
}
xlog( "nobody available \n");
t_reply("500", "Server error");
}
# Per SIP request initial checks
route[REQINIT] {
# no connect for sending replies
set_reply_no_connect();
#!ifdef WITH_ANTIFLOOD
# flood detection from same IP and traffic ban for a while
# be sure you exclude checking trusted peers, such as pstn gateways
# - local host excluded (e.g., loop to self)
if(src_ip!=myself) {
if($sht(ipban=>$si)!=$null) {
# ip is already blocked
xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n");
exit;
}
if (!pike_check_req()) {
xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
$sht(ipban=>$si) = 1;
exit;
}
}
#!endif
if($ua =~ "friendly-scanner|sipcli|sipvicious|VaxSIPUserAgent") {
# silent drop for scanners - uncomment next line if want to reply
# sl_send_reply("200", "OK");
exit;
}
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(is_method("OPTIONS") && uri==myself && $rU==$null) {
sl_send_reply("200","Keepalive");
exit;
}
if(!sanity_check("17895", "7")) {
xlog("Malformed SIP request from $si:$sp\n");
exit;
}
}
Problem is that in your config your serial forking route runs before looking into Kamailio location DB. So after first fork to 1001#192.168.50.131 you need somehow to route call to part where Kamailio looks into location DB, in default config it is route(LOCATION). Something like this:
route[SERIAL]{
$ru = "sip:1001#192.168.50.131:5060";
xlog("ALERT : new request uri $ru \n");
t_on_failure("1");
route(location);
}
Don't forget to add route(location) to your config.

sass-lint restrict partial BEM rule

Let's say I have a class: myclass__button-create--success.
I want to limit the usage of -create part in:
.myclass__button {
&-create {
}
}
As it's not a new block, element or modifier.
Allowed structures:
.myclass__button-create {
&--success {
}
}
.myclass {
&__button-create {
}
}
.myclass__button-create--success {
}
Any idea how to achieve this restriction using sass-lint?

Obtaining next set of results

I've searched around but cannot seem to find the answer to this, I need to access more pages worth of results from a places search. I noticed in the JSON response there is a next field with a URL that, when clicked in the browser, calls a further 20 results. However I haven't been able to access this field in my C# application. Below is the JSON response (text format).
{
results: {next:https://places.cit.api.here.com/places/v1/discover/search;context=Zmxv...
items: [
{ The Botanist }
{ Alexanders Jazz Theatre Bar }
{ The Architect }
{ 1539 Restaurant & Bar }
{ Barlounge Chester }
{ Meze }
{ Hanky Panky Pancakes }
{ The Slowboat }
{ The Moorings }
{ Missoula }
{ Istanbul BBQ }
{ Chip-O-Dee }
{ The Flower Cup }
{ Mama K's Burritos }
{ The Stage Door Cafe Chester }
{ Cinderbox Coffee }
{ Wok&Go }
{ Covino }
{ Urbano 32 }
{ Beatons Tearooms }
]
}
search: {
context: { urn:nlp-types:place }
supportsPanning:true
ranking:category-recommendations
}
}
And my C# classes used to access the fields, the next string just returns null:
[System.Serializable]
public class Response
{
public results results;
}
[System.Serializable]
public class results
{
public string next;
public string previous;
public items[] items;
}
Thank you
Places API is built from a consumer perspective and restricted only to return the first 100(relevant) POIs around a location. There is no provision to get all the POIs as of today.

Intershop 7.8 setting.gradle, jvm arguments

In the following cookbook chapter 3.3.3:
https://support.intershop.com/kb/index.php/Display/2V8150
There is a configuration for the jvm arguments, which is not working.
I've tried 4 different configs and they all crash my deploy:
tomcat {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096
minHeapSize = 2048
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
tomcat {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096m
minHeapSize = 2048m
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
appserver {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096
minHeapSize = 2048
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
appserver {
instances {
appserver0 {
jvmArgs {
maxHeapSize = 4096m
minHeapSize = 2048m
additionalJvmArgs = ['\\u0022-XX:MaxPermSize=256m\\u0022']
}
}
}
}
Does someone has this configuration setting working?
The problem seems to be the additional JVM arguments. When leaving this out it works.
This will result in the following code snippet.
tomcat {
instances {
appserver0 {
jvmArgs {
minHeapSize = 2048
maxHeapSize = 4096
}
}
}
}
There was a defect in the deployment tools that caused double quotes to be preceded by a backslash character in the resulting file (in this case the process.appserver0.command property value in $IS_HOME/engine/nodemanager/config/nodemanager.properties). Please check the resulting property value in the nodemanager.properties file and the command line logged into the $IS_HOME/log/nodemanager.log and $IS_HOME/log/appserver0.log files.
The option in the $IS_HOME/engine/nodemanager/config/nodemanager.properties file should be surrounded by double quotes or the encoded form \u0022 – otherwise Windows interprets the = character as a separator (surrounding the option with double quotes is not necessary on Linux platforms).
This underlying issue has been fixed with Gradle tools version 2.11.6.
Please note that the support of the XX:MaxPermSize option was removed in JDK 8.0 (the option is ignored and results in a warning message).

How to retrieve vista's network status (e.g. "Local Only", "Local and Internet") in powershell

I have a flaky NIC that drops out from time to time, especially after resuming from hibernation. A drop-out corresponds to Vista's network status showing in the notification area as "Local Only". Is there a way of retrieving these status values (e.g. "Limited Connectivity", "Local Only", "Local and Internet") programmatically?
I am writing a powershell script that polls to see if the connection is down, and if so, resets the adapter. Currently I am trying to detect the connection state by pinging my ISP's DNS server. However, since the OS is already correctly identifying this condition, it would be much simpler if I could just retrieve this value.
Thanks!
Try this function:
PS> function Get-NetworkStatus {
$t = [Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")
$networkListManager = [Activator]::CreateInstance($t)
$connections = $networkListManager.GetNetworkConnections()
function getconnectivity {
param($network)
switch ($network.GetConnectivity()) {
0x0000 { 'disconnected' }
{ $_ -band 0x0001 } { 'IPV4_NOTRAFFIC' }
{ $_ -band 0x0002 } { 'IPV6_NOTRAFFIC' }
{ $_ -band 0x0010 } { 'IPV4_SUBNET' }
{ $_ -band 0x0020 } { 'IPV4_LOCALNETWORK' }
{ $_ -band 0x0040 } { 'IPV4_INTERNET' }
{ $_ -band 0x0100 } { 'IPV6_SUBNET' }
{ $_ -band 0x0200 } { 'IPV6_LOCALNETWORK' }
{ $_ -band 0x0400 } { 'IPV6_INTERNET' }
}
}
$connections |
% {
$n = $_.GetNetwork();
$name = $n.GetName();
$category = switch($n.GetCategory()) { 0 { 'public' } 1 { 'private' } 2 { 'domain' } }
$connectivity = getConnectivity $n
new-object PsObject -property #{Name=$name; Category=$category; Connectivity=$connectivity }
}
}
PS> Get-NetworkStatus
Name Connectivity Category
---- ------------ --------
Neznámá síť {IPV4_NOTRAFFIC, IPV6_NOTRAFFIC} public
stefan {IPV6_NOTRAFFIC, IPV4_INTERNET} private
If you pipe $connections and output from GetNetwork() to Get-Member you will find some more useful methods.

Resources