* [LARTC] Split access problems.
@ 2003-10-22 19:03 Mike Taekema
0 siblings, 0 replies; 3+ messages in thread
From: Mike Taekema @ 2003-10-22 19:03 UTC (permalink / raw)
To: lartc
Good day,
I seem to be having getting my split access scripts to run properly. Here is
my split_access script:
IF1=eth0
IF2=eth1
IP1\x10.123.124.52
IP2\x10.123.124.240
P1\x10.123.124.1
P2\x10.123.124.251
P1_NET\x10.123.124.0/25
P2_NET\x10.123.124.128/25
IFE0=eth0
IFE1=eth1
ip route flush all
ip route add $P1_NET dev $IF1 src $IP1 table $IFE0
ip route add default via $P1 table $IFE0
ip route add $P2_NET dev $IF2 src $IP2 table $IFE1
ip route add default via $P2 table $IFE1
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
ip route add default via $P1
ip rule add from $IP1 table $IFE0
ip rule add from $IP2 table $IFE1
exit 0
Now here is my rt_tables file:
#
# reserved values
#
255 local
254 main
253 default
0 unspec
2 eth0
4 eth1
#
# local
#
1 inr.ruhep
Now when I run the script I get these errors: (run script using sh -x
split_access)
+ IF1=eth0
+ IF2=eth1
+ IP1\x10.123.124.52
+ IP2\x10.123.124.240
+ P1\x10.123.124.1
+ P2\x10.123.124.251
+ P1_NET\x10.123.124.0/25
+ P2_NET\x10.123.124.128/25
+ IFE0=eth0
+ IFE1=eth1
+ ip route flush all
+ ip route add 10.123.124.0/25 dev eth0 src 10.123.124.52 table eth0
+ ip route add default via 10.123.124.1 table eth0
+ ip route add 10.123.124.128/25 dev eth1 src 10.123.124.240 table eth1
+ ip route add default via 10.123.124.251 table eth1
RTNETLINK answers: File exists
+ ip route add 10.123.124.0/25 dev eth0 src 10.123.124.52
RTNETLINK answers: File exists
+ ip route add 10.123.124.128/25 dev eth1 src 10.123.124.240
RTNETLINK answers: File exists
+ ip route add default via 10.123.124.1
RTNETLINK answers: File exists
+ ip rule add from 10.123.124.52 table eth0
RTNETLINK answers: Invalid argument
+ ip rule add from 10.123.124.240 table eth1
RTNETLINK answers: Invalid argument
+ exit 0
Why am I getting "file exists and Invalid arguments again?
Thanks in advance
-Mike T.
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LARTC] Split Access Problems
@ 2003-10-16 20:29 Mike Taekema
2003-10-17 2:59 ` gypsy
0 siblings, 1 reply; 3+ messages in thread
From: Mike Taekema @ 2003-10-16 20:29 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 1772 bytes --]
Good day,
I've searched through the mailman lists and no one seems to have had my problem yet. Here goes:
I've wrote a script that goes through and creates the split access steps. However I have changed somethings.
I've declared all my variables at the top of the shell script.
I only have one physical external ip address. So i created a virtual addess at eth0:0
My first problem is when I run the line: ip route add $P1_NET dev $IF1 src $IP1 table T1
I get the error: Error: argument "T1" is wrong: "table" value is invalid
For reference sake here is my script:
IF1=eth0
IF2=eth0:0
IP1=10.123.124.52
IP2=10.123.124.53
P1=10.123.124.253
P2=10.123.124.251
P1_NET=10.123.124.0/24
P2_NET=10.123.124.0/24
# Now lets add routes to two separate tables (T1, T2). This just tidy's things up a bit.
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
# Now we setup our main routing table.
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2
# Now we prefrence our default route
ip route add default via $P1
# Next, setup the routing rules. These choose what routing table to route with. Make sure you
# route out a given interface if you already have the corresponding address.
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2
exit 0
Intelligent Digital Security.
Mike Taekema
mike@netmaster.com
www.netmaster.com
Page Me!
[-- Attachment #1.2: Type: text/html, Size: 6664 bytes --]
[-- Attachment #2: Netmaster-Main Logo.gif --]
[-- Type: image/gif, Size: 3740 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-22 19:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-22 19:03 [LARTC] Split access problems Mike Taekema
-- strict thread matches above, loose matches on Subject: below --
2003-10-16 20:29 [LARTC] Split Access Problems Mike Taekema
2003-10-17 2:59 ` gypsy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.