i just want to kno if the default gw part is correct should it be with or without the brackets ?

#!/bin/bash
    ifconfig eth0 146.192.188.106 netmask 255.255.255.0 broadcast 146.192.188.255 up
    sudo route add default [gw]  146.192.188.254 dev eth0
   
    ifconfig eth1 10.10.160.188 netmask 255.255.255.0 broadcast 10.10.160.255 up
    sudo route add default [gw] 10.10.160.188 dev eth1
   
    ifconfig eth2  192.168.1.188 netmask 255.255.255.0 broadcast 192.168.1.255 up
    sudo route add default [gw] 192.168.1.188 dev eth2
   
iptables -A FORWARD -p tcp -m state --state New --source 146.192.188.254 --dport 3882 -j ACCEPT
iptables -A FORWARD -p tcp -m state --state New --source 146.192.188.254  -j DROP

fail.. I'm sure you shouldn't be asking for coursework answers on a forum. CTEC2701 I believe.

Perhaps instead of asking people to do your work for you, use the man command to work out how to configure your nics correctly and put a testing environment in place.

there is nothing wrong with asking for help

I suggest you try Google then. Or even the manual pages on linux. Both will answer your question quite easily. You should always check these places before asking others or frankly that are not going to help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.