Creating bridge on CentOS.

  • 0
brctl addbr br0
brctl addif enp0s8

brctl delif enp0s8

ip link set br0 up
ifconfig br0 0.0.0.0 0.0.0.0 up

Setting up static IPs from same subnet through one gateway?

1. Enabled ARP filtering:
# sysctl -w net.ipv4.conf.all.arp_filter=1
# echo "net.ipv4.conf.all.arp_filter = 1" >> /etc/sysctl.conf
 
2. Configure /etc/network/interfaces as following:

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
   address 7.7.7.4
   network 7.7.7.0
   netmask 255.255.255.0
   broadcast 7.7.7.255
   up ip route add 7.7.7.0/24 dev eth0 src 7.7.7.4 table eth0table
   up ip route add default via 7.7.7.1 dev eth0 table eth0table
   up ip rule add from 7.7.7.4 table eth0table
   up ip route add 7.7.7.0/24 dev eth0 src 7.7.7.4

auto eth1
iface eth1 inet static
   address 7.7.7.5
   network 7.7.7.0
   netmask 255.255.255.0
   broadcast 7.7.7.255
   up ip route add 7.7.7.0/24 dev eth1 src 7.7.7.5 table eth1table
   up ip route add default via 7.7.7.1 dev eth1 table eth1table
   up ip rule add from 7.7.7.5 table eth1table
   up ip route add default via 7.7.7.1 dev eth1
   up ip route add 7.7.7.0/24 dev eth1 src 7.7.7.5
 
Add the following two lines to /etc/iproute2/rt_tables

10 eth0table
20 eth1table
 
 
The following is also relevant:

A common configuration is the following, in which there are two providers that connect a local network (or even a single machine) to the big Internet.
                                                                 ________
                                          +------------+        /
                                          |            |       |
                            +-------------+ Provider 1 +-------
        __                  |             |            |     /
    ___/  \_         +------+-------+     +------------+    |
  _/        \__      |     if1      |                      /
 /             \     |              |                      |
| Local network -----+ Linux router |                      |     Internet
 \_           __/    |              |                      |
   \__     __/       |     if2      |                      \
      \___/          +------+-------+     +------------+    |
                            |             |            |     \
                            +-------------+ Provider 2 +-------
                                          |            |       |
                                          +------------+        \________
There are usually two questions given this setup.

4.2.1. Split access

The first is how to route answers to packets coming in over a particular provider, say Provider 1, back out again over that same provider.
Let us first set some symbolical names. Let $IF1 be the name of the first interface (if1 in the picture above) and $IF2 the name of the second interface. Then let $IP1 be the IP address associated with $IF1 and $IP2 the IP address associated with $IF2. Next, let $P1 be the IP address of the gateway at Provider 1, and $P2 the IP address of the gateway at provider 2. Finally, let $P1_NET be the IP network $P1 is in, and $P2_NET the IP network $P2 is in.
One creates two additional routing tables, say T1 and T2. These are added in /etc/iproute2/rt_tables. Then you set up routing in these tables as follows:

   ip route add $P1_NET dev $IF1 src $IP1 table T1
   ip route add default via $P1 table T1
   ip route add $P2_NET dev $IF2 src $IP2 table T2
   ip route add default via $P2 table T2
 
Nothing spectacular, just build a route to the gateway and build a default route via that gateway, as you would do in the case of a single upstream provider, but put the routes in a separate table per provider. Note that the network route suffices, as it tells you how to find any host in that network, which includes the gateway, as specified above. Next you set up the main routing table. It is a good idea to route things to the direct neighbour through the interface connected to that neighbour. Note the `src' arguments, they make sure the right outgoing IP address is chosen. 

     ip route add $P1_NET dev $IF1 src $IP1
     ip route add $P2_NET dev $IF2 src $IP2
   
Then, your preference for default route:

     ip route add default via $P1
   
Next, you set up the routing rules. These actually choose what routing table to route with. You want to make sure that you route out a given interface if you already have the corresponding source address:
     ip rule add from $IP1 table T1
     ip rule add from $IP2 table T2
   
This set of commands makes sure all answers to traffic coming in on a particular interface get answered from that interface.

notes: 'If $P0_NET is the local network and $IF0 is its interface, the following additional entries are desirable: 

ip route add $P0_NET     dev $IF0 table T1
ip route add $P2_NET     dev $IF2 table T1
ip route add 127.0.0.0/8 dev lo   table T1
ip route add $P0_NET     dev $IF0 table T2
ip route add $P1_NET     dev $IF1 table T2
ip route add 127.0.0.0/8 dev lo   table T2                             


Now, this is just the very basic setup. It will work for all processes running on the router itself, and for the local network, if it is masqueraded. If it is not, then you either have IP space from both providers or you are going to want to masquerade to one of the two providers. In both cases you will want to add rules selecting which provider to route out from based on the IP address of the machine in the local network.

4.2.2. Load balancing

The second question is how to balance traffic going out over the two providers. This is actually not hard if you already have set up split access as above.
Instead of choosing one of the two providers as your default route, you now set up the default route to be a multipath route. In the default kernel this will balance routes over the two providers. It is done as follows (once more building on the example in the section on split-access):

     ip route add default scope global nexthop via $P1 dev $IF1 weight 1 \
     nexthop via $P2 dev $IF2 weight 1
   
This will balance the routes over both providers. The weight parameters can be tweaked to favor one provider over the other. Note that balancing will not be perfect, as it is route based, and routes are cached. This means that routes to often-used sites will always be over the same provider.
Furthermore, if you really want to do this, you probably also want to look at Julian Anastasov's patches at http://www.ssi.bg/~ja/#routes , Julian's route patch page. They will make things nicer to work with.
  

Open malicious websites safely!

  • 0














=> Install Links:

1. "Private Tab": https://addons.mozilla.org/en-US/firefox/addon/private-tab
2. "No-Script": https://addons.mozilla.org/en-US/firefox/addon/noscript 















In the following screenshot you can see "No-Script" blocked JavaScript!














Now this is where I have landed following that Rouge Link. As Most of the malicious scripts were blocked by "No-Script" this is what is being displayed to me:

Prerouting and Post Routing

NAT table is consulted when a packet that creates a new connection is encountered. It consists of three built-ins:
PREROUTING (for altering packets as soon as they come in),
OUTPUT (for altering locally-generated packets before routing), and 
POSTROUTING (for altering packets as they are about to go out).

PREROUTING - DNAT for incoming packets
OUTPUT - DNAT for outgoing local packets
POSTROUTING - SNAT for outgoing local/forwarded packets

Configuring Inventum Software NAS

----------------------------------------------------------
=>Inventum Login:
User: root
Password: inventumadmin
----------------------------------------------------------
=> Initial Setup
main->show
----------------------------------------------------------
=>Displaying the Connected Interfaces:
main->diag
ifconfig
=>Verify: BROADCAST RUNNING MULTICAST
=>To exit from DIAG: quit
=>List all PCI devices:
main->config->pci
----------------------------------------------------------
=> To load Drivers:
main->config
help
list drivers
=>Look at the driver name. For ex: e1000
=>Press Enter to continue till the list ends.
load e1000
=>To display what is already loaded:
loaded
=>To unload/uninstall:
unload e1000
save
=>To reboot the NAS:
main
reset/restart
----------------------------------------------------------
=>Change Default Inventum Password:
main->config
change user root password 145236
----------------------------------------------------------
=> List all Users:
main->config
list users
=> Delete User:
del user soham
=>Add User:
add user soham password 145236789 role mgr
----------------------------------------------------------
=>Set IPs to Interfaces:
main->interface
set eth0 10.11.12.2 mask 255.255.255.240
set eth1 10.11.12.1 mask 255.255.255.240
----------------------------------------------------------
=>Inventum Set Default Route/Gateway:
main->route
set default 10.11.12.1

>Display All Routes:
main->diag
route
----------------------------------------------------------
=> Setting up DNS:
main->dns->show
add ns 8.8.8.8
del ns 208.67.222.222
----------------------------------------------------------
=>Set SNAT
main->snat
help
----------------------------------------------------------
=> Set Policy Url:
main->url
help
set policy url 203.12.122.122
----------------------------------------------------------
=>Set Firewall:
main->firewall
show

dd allow from 203.12.122.122 to any protocol any
add allow from any to 203.12.122.122 protocol any

dd allow from any to any protocol tcp/80/
add allow from any to any protocol tcp//80
----------------------------------------------------------
=> Show running Processes:
main->diag-> ?
ps
=>Check NAS Uptime:
uptime
=> Free RAM:
free

cpdump
iptraf
netstat
arp
clear-ssh-identity
----------------------------------------------------------
=>To do nslookup:
main
nslookup
----------------------------------------------------------
=>Enabling Authsrv service:
main->authsrv
show

ervice on
set port eth1 wan
set port eth0 lan
qos on
----------------------------------------------------------
=> Enable Packet Logging:
main->plog
set logging on
format extended
reload

et logging to 10.11.12.5 8080
----------------------------------------------------------
=> Enable Syslog Logging:
set logging on
set logging to 10.11.12.5 8080
set log level err
reload
----------------------------------------------------------